Merge pull request #31372 from nextcloud/enh/noid/prevent-right-click-for-hide-download

prevent default right-click options when hideDownload is enabled
This commit is contained in:
Vincent Petry 2022-03-03 16:45:16 +01:00 committed by GitHub
commit b8d4be404c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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) {