Fix ULS dialog positioning in some cases

In development environment, ev.currentTarget is the button.
In Beta Cluster, however, once ext.uls.mediawiki is loaded,
it is now the document (the event has bubbled up). I do not
know what causes the difference, but we can use the target.

Bug: T276255
Change-Id: Ie4c425510293a6f2ce81e4bf4a353f2c8d86d412
This commit is contained in:
Niklas Laxström
2021-03-24 10:32:08 +01:00
parent db4e86284d
commit 3af22f60d4

View File

@@ -461,7 +461,7 @@
mw.loader.using( 'ext.uls.mediawiki' ).then( function () {
var $target, parent, languageNodes, standalone, uls;
$target = $( ev.currentTarget );
$target = $( ev.target );
parent = document.querySelectorAll( '.mw-portlet-lang, #p-lang' )[ 0 ];
languageNodes = parent ? parent.querySelectorAll( '.interlanguage-link-target' ) : [];
standalone = isUsingStandaloneLanguageButton();