Rename edit preference in UI

The preference hide_line_numbers was mistakenly mapped to just "Line
numbers" in the UI. This change modifies the label, checkbox ID, and
behavior to reflect the preferences schema and reduce confusion.

Bug: Issue 8251
Change-Id: Icb23dae277ec4cfc2fe161d52c5c20fa211fa629
This commit is contained in:
Kasper Nilsson
2018-01-30 14:45:29 -08:00
parent f7fad60c18
commit 1a43143d8d
3 changed files with 7 additions and 11 deletions

View File

@@ -82,10 +82,10 @@ limitations under the License.
</span>
</section>
<section>
<span class="title">Line numbers</span>
<span class="title">Hide line numbers</span>
<span class="value">
<input
id="showLineNumbers"
id="hideLineNumbers"
type="checkbox"
checked$="[[editPrefs.hide_line_numbers]]"
on-change="_handleLineNumbersChanged">

View File

@@ -50,7 +50,7 @@
},
_handleLineNumbersChanged() {
this.set('editPrefs.hide_line_numbers', !this.$.showLineNumbers.checked);
this.set('editPrefs.hide_line_numbers', this.$.hideLineNumbers.checked);
this._handleEditPrefsChanged();
},
@@ -75,14 +75,10 @@
this._handleEditPrefsChanged();
},
_handleShowBaseVersionChanged() {
this.set('editPrefs.show_base', this.$.showShowBaseVersion.checked);
this._handleEditPrefsChanged();
},
save() {
return this.$.restAPI.saveEditPreferences(this.editPrefs)
.then(() => { this.hasUnsavedChanges = false; });
return this.$.restAPI.saveEditPreferences(this.editPrefs).then(res => {
this.hasUnsavedChanges = false;
});
},
});
})();

View File

@@ -93,7 +93,7 @@ limitations under the License.
.firstElementChild.checked, editPreferences.syntax_highlighting);
assert.equal(valueOf('Show tabs', 'editPreferences')
.firstElementChild.checked, editPreferences.show_tabs);
assert.equal(valueOf('Line numbers', 'editPreferences')
assert.equal(valueOf('Hide line numbers', 'editPreferences')
.firstElementChild.checked, editPreferences.hide_line_numbers);
assert.equal(valueOf('Match brackets', 'editPreferences')
.firstElementChild.checked, editPreferences.match_brackets);