From be99ff9a554572061d84c7eb6404d83857dfa5e4 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Thu, 14 Nov 2013 11:10:01 +0530 Subject: [PATCH] Fix bug: Cannot apply changes after switching panels back and forth Bug: 57011 Change-Id: I0614d97dea99781f46bb80a496b12c95aef55c8c --- resources/js/ext.uls.displaysettings.js | 7 ++----- resources/js/ext.uls.inputsettings.js | 6 ++---- resources/js/ext.uls.languagesettings.js | 4 ++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index 234ed15a..1533ecd4 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -102,7 +102,6 @@ this.$parent.$settingsPanel.empty(); this.$webfonts = $( 'body' ).data( 'webfonts' ); this.$parent.$settingsPanel.append( this.$template ); - this.disableApplyButton(); this.prepareLanguages(); this.prepareUIFonts(); this.prepareContentFonts(); @@ -480,10 +479,6 @@ this.$parent.$window.find( 'button.uls-settings-apply' ).removeAttr( 'disabled' ); }, - disableApplyButton: function () { - this.$parent.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', true ); - }, - /** * Register general event listeners */ @@ -567,6 +562,8 @@ if ( this.uiLanguage !== this.getUILanguage() ) { mw.uls.changeLanguage( this.uiLanguage ); } + // Disable apply button + this.$parent.disableApplyButton(); } // @todo What to do in case of failure? }, diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 814304ab..1735c429 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -105,10 +105,6 @@ this.$parent.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', false ); }, - disableApplyButton: function () { - this.$parent.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', true ); - }, - prepareInputmethods: function ( language ) { var index, inputSettings, $imeListContainer, defaultInputmethod, imes, selected, imeId, $imeListTitle; @@ -494,6 +490,8 @@ if ( success ) { // Live ime update this.$parent.hide(); + // Disable apply button + this.$parent.disableApplyButton(); } // FIXME in case of failure. what to do?! }, diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index 153d5542..8b75c36e 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -261,6 +261,10 @@ } else { this.show(); } + }, + + disableApplyButton: function () { + this.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', true ); } };