From d388921186baa7dcaaf03a206f9be1e648a58548 Mon Sep 17 00:00:00 2001 From: szaimen Date: Sat, 26 Feb 2022 14:20:56 +0100 Subject: prevent right-click when hideDownload is enabled Signed-off-by: szaimen --- apps/files_sharing/js/public.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/files_sharing') 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) { -- cgit v1.2.3