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:
@@ -82,10 +82,10 @@ limitations under the License.
|
|||||||
</span>
|
</span>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<span class="title">Line numbers</span>
|
<span class="title">Hide line numbers</span>
|
||||||
<span class="value">
|
<span class="value">
|
||||||
<input
|
<input
|
||||||
id="showLineNumbers"
|
id="hideLineNumbers"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked$="[[editPrefs.hide_line_numbers]]"
|
checked$="[[editPrefs.hide_line_numbers]]"
|
||||||
on-change="_handleLineNumbersChanged">
|
on-change="_handleLineNumbersChanged">
|
||||||
|
@@ -50,7 +50,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_handleLineNumbersChanged() {
|
_handleLineNumbersChanged() {
|
||||||
this.set('editPrefs.hide_line_numbers', !this.$.showLineNumbers.checked);
|
this.set('editPrefs.hide_line_numbers', this.$.hideLineNumbers.checked);
|
||||||
this._handleEditPrefsChanged();
|
this._handleEditPrefsChanged();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -75,14 +75,10 @@
|
|||||||
this._handleEditPrefsChanged();
|
this._handleEditPrefsChanged();
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleShowBaseVersionChanged() {
|
|
||||||
this.set('editPrefs.show_base', this.$.showShowBaseVersion.checked);
|
|
||||||
this._handleEditPrefsChanged();
|
|
||||||
},
|
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
return this.$.restAPI.saveEditPreferences(this.editPrefs)
|
return this.$.restAPI.saveEditPreferences(this.editPrefs).then(res => {
|
||||||
.then(() => { this.hasUnsavedChanges = false; });
|
this.hasUnsavedChanges = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
@@ -93,7 +93,7 @@ limitations under the License.
|
|||||||
.firstElementChild.checked, editPreferences.syntax_highlighting);
|
.firstElementChild.checked, editPreferences.syntax_highlighting);
|
||||||
assert.equal(valueOf('Show tabs', 'editPreferences')
|
assert.equal(valueOf('Show tabs', 'editPreferences')
|
||||||
.firstElementChild.checked, editPreferences.show_tabs);
|
.firstElementChild.checked, editPreferences.show_tabs);
|
||||||
assert.equal(valueOf('Line numbers', 'editPreferences')
|
assert.equal(valueOf('Hide line numbers', 'editPreferences')
|
||||||
.firstElementChild.checked, editPreferences.hide_line_numbers);
|
.firstElementChild.checked, editPreferences.hide_line_numbers);
|
||||||
assert.equal(valueOf('Match brackets', 'editPreferences')
|
assert.equal(valueOf('Match brackets', 'editPreferences')
|
||||||
.firstElementChild.checked, editPreferences.match_brackets);
|
.firstElementChild.checked, editPreferences.match_brackets);
|
||||||
|
Reference in New Issue
Block a user