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