Merge "Don't open images if control keys are pressed"

This commit is contained in:
jenkins-bot 2018-11-20 21:41:03 +00:00 committed by Gerrit Code Review
commit 09534b7b84
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,12 @@
* @ignore
*/
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();
routeThumbnail( $( this ).data( 'thumb' ) );
}