Fix cancel behaviour of display settings
Font selection becomes persistent despite cancelling it Bug: 47976 Change-Id: Iea4b65a8a13da3cb4a86f5b6521d62cb1372b42a
This commit is contained in:
@@ -434,7 +434,8 @@
|
||||
var displaySettings = this,
|
||||
$contentFontSelector = this.$template.find( '#content-font-selector' ),
|
||||
$uiFontSelector = this.$template.find( '#ui-font-selector' ),
|
||||
oldFont = $uiFontSelector.find( 'option:selected' ).val(),
|
||||
oldUIFont = $uiFontSelector.find( 'option:selected' ).val(),
|
||||
oldContentFont = $contentFontSelector.find( 'option:selected' ).val(),
|
||||
$tabButtons = displaySettings.$template.find( '.uls-display-settings-tab-switcher button' );
|
||||
|
||||
// TODO all these repeated selectors can be placed in object constructor.
|
||||
@@ -444,7 +445,8 @@
|
||||
} );
|
||||
|
||||
displaySettings.$template.find( 'button.uls-display-settings-cancel' ).on( 'click', function () {
|
||||
mw.webfonts.preferences.setFont( displaySettings.contentLanguage, oldFont );
|
||||
mw.webfonts.preferences.setFont( displaySettings.contentLanguage, oldContentFont );
|
||||
mw.webfonts.preferences.setFont( displaySettings.uiLanguage, oldUIFont );
|
||||
|
||||
if ( displaySettings.$webfonts ) {
|
||||
displaySettings.$webfonts.refresh();
|
||||
@@ -459,7 +461,8 @@
|
||||
$button.removeClass( 'down' );
|
||||
}
|
||||
} );
|
||||
|
||||
displaySettings.prepareUIFonts();
|
||||
displaySettings.prepareContentFonts();
|
||||
displaySettings.close();
|
||||
} );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user