]> source.dussan.org Git - nextcloud-server.git/commitdiff
prevent right-click when hideDownload is enabled 31372/head
authorszaimen <szaimen@e.mail.de>
Sat, 26 Feb 2022 13:20:56 +0000 (14:20 +0100)
committerszaimen <szaimen@e.mail.de>
Thu, 3 Mar 2022 13:02:41 +0000 (14:02 +0100)
Signed-off-by: szaimen <szaimen@e.mail.de>
apps/files_sharing/js/public.js

index b31022fc2cce3f19e174a081612ba41253a1194e..6b063896b7f24162f94ae94335dfa5e2decd2322 100644 (file)
@@ -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) {