diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index 811adea3..234ed15a 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -571,10 +571,18 @@ }, /** - * Handle the apply button press + * Handle the apply button press. + * Note that the button press may not be from the input settings module. + * For example, a user can change input settings and then go to display settings panel, + * do some changes and press apply button there. That press is applicable for all + * modules. */ apply: function () { var displaySettings = this; + if ( !displaySettings.dirty ) { + // No changes to save in this module. + return; + } // Save the preferences mw.webfonts.preferences.save( function ( result ) { diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 2d7c0975..09d4b16f 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -500,7 +500,11 @@ }, /** - * Handle the apply button press + * Handle the apply button press. + * Note that the button press may not be from the input settings module. + * For example, a user can change input settings and then go to display settings panel, + * do some changes and press apply button there. That press is applicable for all + * modules. */ apply: function () { var previousIM, @@ -510,6 +514,11 @@ currentLanguage = $.ime.preferences.getLanguage(), currentIM = $.ime.preferences.getIM( currentLanguage ); + if ( !inputSettings.dirty ) { + // No changes to save in this module. + return; + } + if ( previousLanguage ) { previousIM = inputSettings.savedRegistry.imes[previousLanguage]; }