diff options
Diffstat (limited to 'MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js')
-rw-r--r-- | MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js index e2bfe9de..ebba612d 100644 --- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js +++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.launch.js @@ -60,6 +60,12 @@ function launchULS( $trigger, languagesObject, forCLS ) { ) { return; } + + // TODO: The name of this hook should probably be changed to reflect that it covers + // both the user changing their interface language and the user switching to a + // different language. + mw.hook( 'mw.uls.interface.language.change' ).fire( language, 'content-language-switcher' ); + location.href = languagesObject[ language ].href; }, onPosition: function () { @@ -91,6 +97,9 @@ function launchULS( $trigger, languagesObject, forCLS ) { }, onVisible: function () { $trigger.addClass( 'selector-open' ); + + // Note well that this hook is unstable. + mw.hook( 'mw.uls.compact_language_links.open' ).fire( $trigger ); }, languageDecorator: function ( $languageLink, language ) { var element = languagesObject[ language ]; |