Fixed Bug 39832 - Cancel / Apply button on Display settings
Change-Id: Ie536dbe1615db98c201b8c7fd1b5b58647bb1199
This commit is contained in:
@@ -361,12 +361,16 @@
|
|||||||
* Register general event listeners
|
* Register general event listeners
|
||||||
*/
|
*/
|
||||||
listen: function () {
|
listen: function () {
|
||||||
var that = this, $contentFontSelector, $uiFontSelector;
|
var that = this, $contentFontSelector, $uiFontSelector, oldFont;
|
||||||
|
|
||||||
|
|
||||||
$contentFontSelector = this.$template
|
$contentFontSelector = this.$template
|
||||||
.find( '#content-font-selector' );
|
.find( '#content-font-selector' );
|
||||||
$uiFontSelector = this.$template
|
$uiFontSelector = this.$template
|
||||||
.find( 'select#ui-font-selector' );
|
.find( 'select#ui-font-selector' );
|
||||||
|
|
||||||
|
oldFont = $uiFontSelector.find( 'option:selected' ).val();
|
||||||
|
|
||||||
// TODO all these repeated selectors can be placed in object constructor.
|
// TODO all these repeated selectors can be placed in object constructor.
|
||||||
|
|
||||||
this.$template.find( '#uls-displaysettings-apply' ).on( 'click', function () {
|
this.$template.find( '#uls-displaysettings-apply' ).on( 'click', function () {
|
||||||
@@ -374,6 +378,8 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
this.$template.find( 'button.uls-settings-close' ).on( 'click', function () {
|
this.$template.find( 'button.uls-settings-close' ).on( 'click', function () {
|
||||||
|
mw.webfonts.preferences.setFont( that.contentLanguage, oldFont );
|
||||||
|
that.$webfonts.refresh();
|
||||||
that.close();
|
that.close();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user