CompactLinks: Better handling of opening links to new tab/window
* Check for any of Shift, Ctrl or Meta * Only do it for links * Support both mouse and keyboard Change-Id: I0b331b802e1d96ae0e0511746d6b42663db924b1
This commit is contained in:
committed by
jenkins-bot
parent
78884e87b2
commit
4387bb9d61
@@ -52,11 +52,15 @@ function launchULS( $trigger, languagesObject ) {
|
||||
$trigger.removeClass( 'selector-open' );
|
||||
mw.uls.addPreviousLanguage( language );
|
||||
|
||||
// Switch the current tab to the new language,
|
||||
// unless it was Ctrl-click or Command-click
|
||||
if ( !event.metaKey && !event.shiftKey ) {
|
||||
location.href = languagesObject[ language ].href;
|
||||
// Switch the current tab to the new language, unless it was
|
||||
// {Ctrl,Shift,Command} activation on a link
|
||||
if (
|
||||
event.target instanceof HTMLAnchorElement &&
|
||||
( event.metaKey || event.shiftKey || event.ctrlKey )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
location.href = languagesObject[ language ].href;
|
||||
},
|
||||
onVisible: function () {
|
||||
var offset, height, width, triangleWidth;
|
||||
|
||||
Reference in New Issue
Block a user