From 49924e9ec5f6b9b4d2b44bedc49ef2c8474ae686 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Tue, 25 May 2021 17:36:06 +0100 Subject: [PATCH] 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 --- resources/js/ext.uls.launch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/js/ext.uls.launch.js b/resources/js/ext.uls.launch.js index 766a28ed..b1bcac52 100644 --- a/resources/js/ext.uls.launch.js +++ b/resources/js/ext.uls.launch.js @@ -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 ];