(bug 42440) Fix button state when canceling
Also changed class names to make finding cancel buttons easier. Change-Id: Ieaf242eb03add06038307d913a87a196d41ba01d
This commit is contained in:
committed by
Gerrit Code Review
parent
e7d1965f7c
commit
80ce8e068b
@@ -80,7 +80,7 @@
|
||||
// Apply and Cancel buttons
|
||||
+ '<div class="row language-settings-buttons">'
|
||||
+ '<div class="eleven columns">'
|
||||
+ '<button class="button uls-settings-close" data-i18n="ext-uls-language-settings-cancel"></button>'
|
||||
+ '<button class="button uls-display-settings-cancel" data-i18n="ext-uls-language-settings-cancel"></button>'
|
||||
+ '<button class="button active blue" id="uls-displaysettings-apply" data-i18n="ext-uls-language-settings-apply" disabled></button>'
|
||||
+ '</div>'
|
||||
+ '</div>'
|
||||
@@ -403,9 +403,20 @@
|
||||
displaySettings.apply();
|
||||
} );
|
||||
|
||||
this.$template.find( 'button.uls-settings-close' ).on( 'click', function () {
|
||||
this.$template.find( 'button.uls-display-settings-cancel' ).on( 'click', function () {
|
||||
mw.webfonts.preferences.setFont( displaySettings.contentLanguage, oldFont );
|
||||
displaySettings.$webfonts.refresh();
|
||||
|
||||
displaySettings.$template.find( 'div.uls-ui-languages button.button' ).each( function () {
|
||||
var $button = $( this );
|
||||
|
||||
if ( $button.attr( 'lang' ) === displaySettings.contentLanguage ) {
|
||||
$button.addClass( 'down' );
|
||||
} else {
|
||||
$button.removeClass( 'down' );
|
||||
}
|
||||
} );
|
||||
|
||||
displaySettings.close();
|
||||
} );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user