Make the behavior of close button same as cancel button
Bug: 53255 Change-Id: If27a770c531d78538c70dd86199f1791b1171c2d
This commit is contained in:
committed by
Amire80
parent
a1ad38d715
commit
0d9bbd8113
@@ -506,8 +506,6 @@
|
|||||||
|
|
||||||
displaySettings.$template.find( 'button.uls-display-settings-cancel' ).on( 'click', function () {
|
displaySettings.$template.find( 'button.uls-display-settings-cancel' ).on( 'click', function () {
|
||||||
displaySettings.cancel();
|
displaySettings.cancel();
|
||||||
displaySettings.prepareUIFonts();
|
|
||||||
displaySettings.prepareContentFonts();
|
|
||||||
displaySettings.close();
|
displaySettings.close();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -566,13 +564,6 @@
|
|||||||
* Depending on the context, actions vary.
|
* Depending on the context, actions vary.
|
||||||
*/
|
*/
|
||||||
close: function () {
|
close: function () {
|
||||||
var origUILanguage = this.getUILanguage();
|
|
||||||
|
|
||||||
if ( $.i18n().locale !== origUILanguage ) {
|
|
||||||
// restore UI localization for display settings panel
|
|
||||||
$.i18n().locale = origUILanguage;
|
|
||||||
this.i18n();
|
|
||||||
}
|
|
||||||
this.$parent.close();
|
this.$parent.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -629,7 +620,8 @@
|
|||||||
* Cancel the changes done by user for display settings
|
* Cancel the changes done by user for display settings
|
||||||
*/
|
*/
|
||||||
cancel: function () {
|
cancel: function () {
|
||||||
var displaySettings = this;
|
var displaySettings = this,
|
||||||
|
origUILanguage = this.getUILanguage();
|
||||||
|
|
||||||
if ( !displaySettings.dirty ) {
|
if ( !displaySettings.dirty ) {
|
||||||
// Nothing changed
|
// Nothing changed
|
||||||
@@ -642,6 +634,12 @@
|
|||||||
displaySettings.$webfonts.refresh();
|
displaySettings.$webfonts.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $.i18n().locale !== origUILanguage ) {
|
||||||
|
// restore UI localization for display settings panel
|
||||||
|
$.i18n().locale = origUILanguage;
|
||||||
|
this.i18n();
|
||||||
|
}
|
||||||
|
|
||||||
// Clear the dirty bit
|
// Clear the dirty bit
|
||||||
displaySettings.dirty = false;
|
displaySettings.dirty = false;
|
||||||
displaySettings.disableApplyButton();
|
displaySettings.disableApplyButton();
|
||||||
@@ -650,6 +648,10 @@
|
|||||||
displaySettings.uiLanguage = displaySettings.getUILanguage();
|
displaySettings.uiLanguage = displaySettings.getUILanguage();
|
||||||
displaySettings.contentLanguage = displaySettings.getContentLanguage();
|
displaySettings.contentLanguage = displaySettings.getContentLanguage();
|
||||||
|
|
||||||
|
// Restore the font dropdowns
|
||||||
|
displaySettings.prepareUIFonts();
|
||||||
|
displaySettings.prepareContentFonts();
|
||||||
|
|
||||||
// Restore the visual state of selected language button
|
// Restore the visual state of selected language button
|
||||||
displaySettings.$template.find( 'div.uls-ui-languages button.button' ).each( function () {
|
displaySettings.$template.find( 'div.uls-ui-languages button.button' ).each( function () {
|
||||||
var $button = $( this );
|
var $button = $( this );
|
||||||
|
|||||||
Reference in New Issue
Block a user