Merge "Fix bug: Cannot apply changes after switching panels back and forth"

This commit is contained in:
jenkins-bot
2013-11-18 20:11:47 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 9 deletions

View File

@@ -102,7 +102,6 @@
this.$parent.$settingsPanel.empty(); this.$parent.$settingsPanel.empty();
this.$webfonts = $( 'body' ).data( 'webfonts' ); this.$webfonts = $( 'body' ).data( 'webfonts' );
this.$parent.$settingsPanel.append( this.$template ); this.$parent.$settingsPanel.append( this.$template );
this.disableApplyButton();
this.prepareLanguages(); this.prepareLanguages();
this.prepareUIFonts(); this.prepareUIFonts();
this.prepareContentFonts(); this.prepareContentFonts();
@@ -480,10 +479,6 @@
this.$parent.$window.find( 'button.uls-settings-apply' ).removeAttr( 'disabled' ); 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 * Register general event listeners
*/ */
@@ -567,6 +562,8 @@
if ( this.uiLanguage !== this.getUILanguage() ) { if ( this.uiLanguage !== this.getUILanguage() ) {
mw.uls.changeLanguage( this.uiLanguage ); mw.uls.changeLanguage( this.uiLanguage );
} }
// Disable apply button
this.$parent.disableApplyButton();
} // @todo What to do in case of failure? } // @todo What to do in case of failure?
}, },

View File

@@ -105,10 +105,6 @@
this.$parent.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', false ); 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 ) { prepareInputmethods: function ( language ) {
var index, inputSettings, $imeListContainer, defaultInputmethod, var index, inputSettings, $imeListContainer, defaultInputmethod,
imes, selected, imeId, $imeListTitle; imes, selected, imeId, $imeListTitle;
@@ -494,6 +490,8 @@
if ( success ) { if ( success ) {
// Live ime update // Live ime update
this.$parent.hide(); this.$parent.hide();
// Disable apply button
this.$parent.disableApplyButton();
} }
// FIXME in case of failure. what to do?! // FIXME in case of failure. what to do?!
}, },

View File

@@ -261,6 +261,10 @@
} else { } else {
this.show(); this.show();
} }
},
disableApplyButton: function () {
this.$window.find( 'button.uls-settings-apply' ).prop( 'disabled', true );
} }
}; };