jenkins-bot has submitted this change and it was merged.
Change subject: Open the download panel when an image is right clicked
......................................................................
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
---
M resources/mmv/ui/mmv.ui.canvas.js
M resources/mmv/ui/mmv.ui.dialog.js
2 files changed, 7 insertions(+), 1 deletion(-)
Approvals:
Gilles: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/mmv/ui/mmv.ui.canvas.js
b/resources/mmv/ui/mmv.ui.canvas.js
index 33d6029..c8b5622 100644
--- a/resources/mmv/ui/mmv.ui.canvas.js
+++ b/resources/mmv/ui/mmv.ui.canvas.js
@@ -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();
+ }
}
} );
};
diff --git a/resources/mmv/ui/mmv.ui.dialog.js
b/resources/mmv/ui/mmv.ui.dialog.js
index e3ce8ac..53118f6 100644
--- a/resources/mmv/ui/mmv.ui.dialog.js
+++ b/resources/mmv/ui/mmv.ui.dialog.js
@@ -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;
}
--
To view, visit https://gerrit.wikimedia.org/r/182353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Namit <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits