summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-03-03 21:32:42 +0100
committerGitHub <noreply@github.com>2022-03-03 21:32:42 +0100
commitdb2fd71868e7cca5c4f38d11884c6117112b4c6e (patch)
treed9adda7feb48e3af1bb1eee55df4b2b38838a5f0
parent47cbb421616016ed1980dd05d3e8ceef6d1592fa (diff)
parentd388921186baa7dcaaf03a206f9be1e648a58548 (diff)
downloadnextcloud-server-db2fd71868e7cca5c4f38d11884c6117112b4c6e.tar.gz
nextcloud-server-db2fd71868e7cca5c4f38d11884c6117112b4c6e.zip
Merge pull request #31427 from nextcloud/backport/31372/stable23
[stable23] prevent default right-click options when hideDownload is enabled
-rw-r--r--apps/files_sharing/js/public.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 3aa4ed78890..ec99d51d34e 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -50,6 +50,14 @@ OCA.Sharing.PublicApp = {
var token = $('#sharingToken').val();
var hideDownload = $('#hideDownload').val();
+ // Prevent all right-click options if hideDownload is enabled
+ if (hideDownload === 'true') {
+ window.oncontextmenu = function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ };
+ }
// file list mode ?
if ($el.find('#filestable').length) {