mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-17 04:43:18 +00:00
Open the download panel when an image is right clicked
Many users right-click on images as a way to download them.Due to this, they may get a scaled-down version which is used for display purposes and also not given guidance on how to attribute. Bug: T75999 Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
This commit is contained in:
parent
0788669bc7
commit
d66509e2de
|
@ -214,9 +214,14 @@
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// open the download panel on right clicking the image
|
||||||
this.$image.on( 'mousedown.mmv-canvas', function ( e ) {
|
this.$image.on( 'mousedown.mmv-canvas', function ( e ) {
|
||||||
if ( e.which === 3 ) {
|
if ( e.which === 3 ) {
|
||||||
mw.mmv.actionLogger.log( 'right-click-image' );
|
mw.mmv.actionLogger.log( 'right-click-image' );
|
||||||
|
if ( !canvas.downloadOpen ) {
|
||||||
|
$( document ).trigger( 'mmv-download-open', e );
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
|
@ -132,7 +132,8 @@
|
||||||
// Don't close the dialog if the click inside a dialog or on an navigation arrow
|
// Don't close the dialog if the click inside a dialog or on an navigation arrow
|
||||||
if ( $clickTarget.closest( dialog.$dialog ).length
|
if ( $clickTarget.closest( dialog.$dialog ).length
|
||||||
|| $clickTarget.closest( '.mw-mmv-next-image' ).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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue