Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2022-02-26 16:20:56 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-03-03 18:48:25 +0300
commitd388921186baa7dcaaf03a206f9be1e648a58548 (patch)
tree3e16e3dcea4dfd6e556cede9f70ea6b5a1e5d71f /apps/files_sharing
parent90340585aae254edef36de2d5e30aa64a1921d9f (diff)
prevent right-click when hideDownload is enabled
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'apps/files_sharing')
-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) {