From: szaimen Date: Sat, 26 Feb 2022 13:20:56 +0000 (+0100) Subject: prevent right-click when hideDownload is enabled X-Git-Tag: v24.0.0beta1~129^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F31372%2Fhead;p=nextcloud-server.git prevent right-click when hideDownload is enabled Signed-off-by: szaimen --- 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) {