Namit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/182353
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
1 file changed, 13 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer
refs/changes/53/182353/1
diff --git a/resources/mmv/ui/mmv.ui.canvas.js
b/resources/mmv/ui/mmv.ui.canvas.js
index 1a45ee1..7812af5 100644
--- a/resources/mmv/ui/mmv.ui.canvas.js
+++ b/resources/mmv/ui/mmv.ui.canvas.js
@@ -213,6 +213,19 @@
} );
}
} );
+
+ // don't open the context menu on right clicking the image
+ this.$image.bind( 'contextmenu', function ( e ) {
+ return false;
+ } );
+
+ // open the download panel on right clicking the image
+ this.$image.mousedown( function ( e ) {
+ if ( e.button === 2 ) {
+ $( document ).trigger( 'mmv-download-open', e );
+ e.stopPropagation();
+ }
+ } );
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/182353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Namit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits