Don't open images if control keys are pressed

This replicates the behavior of the MultimediaViewer on the
desktop when using the mobile page with a desktop browser.

But we have to be careful that this change don't break
other extensions or functions of the skin.

Bug: T206348
Change-Id: Ib4b928eae136d781782dc96e82d653806587292b
This commit is contained in:
LukBukkit 2018-11-19 21:00:47 +01:00
parent c9dee311ea
commit 9e114731ce
No known key found for this signature in database
GPG key ID: C623ED02FBA7BC55

View file

@ -24,6 +24,12 @@
* @ignore * @ignore
*/ */
function onClickImage( ev ) { function onClickImage( ev ) {
// Do not interfere with non-left clicks or if modifier keys are pressed.
if ( ( ev.button !== 0 && ev.which !== 1 ) ||
ev.altKey || ev.ctrlKey || ev.shiftKey || ev.metaKey ) {
return;
}
ev.preventDefault(); ev.preventDefault();
routeThumbnail( $( this ).data( 'thumb' ) ); routeThumbnail( $( this ).data( 'thumb' ) );
} }