Switch the current tab to the new language only if it was not Ctrl/Command/Shift-Click

Bug: T189582
Change-Id: Ib497be874b3d559a8f1715d09160378f0c43881e
This commit is contained in:
Amire80
2018-03-13 14:37:17 +02:00
committed by jenkins-bot
parent 18b99ee358
commit 04a8eeb62c

View File

@@ -134,11 +134,17 @@
* Language selection handler
*
* @param {string} language language code
* @param {Object} event jQuery event object
*/
onSelect: function ( language ) {
onSelect: function ( language, event ) {
self.$trigger.removeClass( 'selector-open' );
mw.uls.addPreviousLanguage( language );
location.href = self.interlanguageList[ language ].href;
// Switch the current tab to the new language,
// unless it was Ctrl-click or Command-click
if ( !event.metaKey && !event.shiftKey ) {
location.href = self.interlanguageList[ language ].href;
}
},
onVisible: function () {
var offset, height, width, triangleWidth;