From 9dd4072d3d36722aed91bab29d0769a6dc152df3 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Thu, 7 Nov 2013 17:41:20 +0530 Subject: [PATCH] Avoid a js error when inputsettings are saved. It happens when input settings are accessed directly while display settings are not initialized. While saving the display settings will not be rendered, causing a js error Change-Id: I3ef1afe67a6bcdc3047b482d697bc03baab6ac47 --- resources/js/ext.uls.displaysettings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index 8b20e94e..8c3f8065 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -88,6 +88,7 @@ this.contentLanguage = this.getContentLanguage(); this.$webfonts = null; this.$parent = $parent; + this.savedRegistry = $.extend( true, {}, mw.webfonts.preferences ); } DisplaySettings.prototype = { @@ -111,7 +112,6 @@ this.preview( this.uiLanguage ); this.listen(); this.dirty = false; - this.savedRegistry = $.extend( true, {}, mw.webfonts.preferences ); }, /** @@ -555,7 +555,7 @@ */ onSave: function ( success ) { if ( success ) { - if ( this.$webfonts !== undefined ) { + if ( this.$webfonts ) { // Live font update this.$webfonts.refresh(); }