From b37b33e02f035b69c315dabda9acfdc3775985a1 Mon Sep 17 00:00:00 2001 From: Ershad K Date: Sun, 11 Nov 2012 12:25:40 +0530 Subject: [PATCH] Fixed Bug 39832 - Cancel / Apply button on Display settings Change-Id: Ie536dbe1615db98c201b8c7fd1b5b58647bb1199 --- resources/js/ext.uls.displaysettings.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index f598d5de..b3329994 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -361,12 +361,16 @@ * Register general event listeners */ listen: function () { - var that = this, $contentFontSelector, $uiFontSelector; + var that = this, $contentFontSelector, $uiFontSelector, oldFont; + $contentFontSelector = this.$template .find( '#content-font-selector' ); $uiFontSelector = this.$template .find( 'select#ui-font-selector' ); + + oldFont = $uiFontSelector.find( 'option:selected' ).val(); + // TODO all these repeated selectors can be placed in object constructor. this.$template.find( '#uls-displaysettings-apply' ).on( 'click', function () { @@ -374,6 +378,8 @@ } ); this.$template.find( 'button.uls-settings-close' ).on( 'click', function () { + mw.webfonts.preferences.setFont( that.contentLanguage, oldFont ); + that.$webfonts.refresh(); that.close(); } );