Merge "Open the download panel when an image is right clicked"

This commit is contained in:
jenkins-bot 2015-01-07 17:39:53 +00:00 committed by Gerrit Code Review
commit 540e7028be
2 changed files with 7 additions and 1 deletions

View file

@ -214,9 +214,14 @@
}
} );
// open the download panel on right clicking the image
this.$image.on( 'mousedown.mmv-canvas', function ( e ) {
if ( e.which === 3 ) {
mw.mmv.actionLogger.log( 'right-click-image' );
if ( !canvas.downloadOpen ) {
$( document ).trigger( 'mmv-download-open', e );
e.stopPropagation();
}
}
} );
};

View file

@ -132,7 +132,8 @@
// Don't close the dialog if the click inside a dialog or on an navigation arrow
if ( $clickTarget.closest( dialog.$dialog ).length
|| $clickTarget.closest( '.mw-mmv-next-image' ).length
|| $clickTarget.closest( '.mw-mmv-prev-image' ).length ) {
|| $clickTarget.closest( '.mw-mmv-prev-image' ).length
|| e.which === 3 ) {
return;
}