diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-03-03 16:45:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 16:45:16 +0100 |
commit | b8d4be404cc8c2dbe652ca9aecc4284e0291306c (patch) | |
tree | ce8eb32192cc17bb640a4c6c6334a0930841a4ef /apps/files_sharing | |
parent | d7109063a3b49cdf976c79399b341bd1a3a5abb3 (diff) | |
parent | 40a51e0e038b970f21f7f1da425ac81c9cd39e92 (diff) | |
download | nextcloud-server-b8d4be404cc8c2dbe652ca9aecc4284e0291306c.tar.gz nextcloud-server-b8d4be404cc8c2dbe652ca9aecc4284e0291306c.zip |
Merge pull request #31372 from nextcloud/enh/noid/prevent-right-click-for-hide-download
prevent default right-click options when hideDownload is enabled
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/public.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index b31022fc2cc..6b063896b7f 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) { |