Fixed Bug 39832 - Cancel / Apply button on Display settings

Change-Id: Ie536dbe1615db98c201b8c7fd1b5b58647bb1199
This commit is contained in:
Ershad K
2012-11-11 12:25:40 +05:30
parent 2482cfca31
commit b37b33e02f

View File

@@ -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();
} );