Pass context to compact_language_links.open hook

Following on from I6fa966c2, fire the mw.uls.compact_language_links.open
hook with the $trigger parameter as context for clients to be able to
able to distinguish which treatment is visible to the user.

Supporting changes:

- Note that the hook is unstable next to its callsite

Bug: T280770
Change-Id: Ie4bbfea4dc5e36401df587550f466aeae5c8fdcc
This commit is contained in:
Sam Smith
2021-05-25 17:36:06 +01:00
committed by jenkins-bot
parent 5baf437b3c
commit 49924e9ec5

View File

@@ -92,7 +92,8 @@ function launchULS( $trigger, languagesObject, forCLS ) {
onVisible: function () {
$trigger.addClass( 'selector-open' );
mw.hook( 'mw.uls.compact_language_links.open' ).fire();
// 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 ];