disable right click menu for images

This commit is contained in:
Abhinav 2022-03-17 17:04:49 +05:30
parent 3089ca2939
commit b84ffbb8bc

View file

@ -260,7 +260,7 @@ const PhotoFrame = ({
if (file.metadata.fileType === FILE_TYPE.VIDEO && !file.html) {
file.html = `
<div class="pswp-item-container">
<img src="${url}" />
<img src="${url}" onContextMenu="return false;"/>
<div class="spinner-border text-light" role="status">
<span class="sr-only">Loading...</span>
</div>
@ -272,7 +272,7 @@ const PhotoFrame = ({
) {
file.html = `
<div class="pswp-item-container">
<img src="${url}" />
<img src="${url}" onContextMenu="return false;"/>
<div class="spinner-border text-light" role="status">
<span class="sr-only">Loading...</span>
</div>
@ -305,7 +305,7 @@ const PhotoFrame = ({
if (file.metadata.fileType === FILE_TYPE.VIDEO) {
if (isPlayable) {
file.html = `
<video controls>
<video controls onContextMenu="return false;">
<source src="${videoURL}" />
Your browser does not support the video tag.
</video>
@ -313,7 +313,7 @@ const PhotoFrame = ({
} else {
file.html = `
<div class="pswp-item-container">
<img src="${file.msrc}" />
<img src="${file.msrc}" onContextMenu="return false;"/>
<div class="download-banner" >
${constants.VIDEO_PLAYBACK_FAILED_DOWNLOAD_INSTEAD}
<a class="btn btn-outline-success" href=${videoURL} download="${file.metadata.title}"">Download</a>
@ -325,8 +325,8 @@ const PhotoFrame = ({
if (isPlayable) {
file.html = `
<div class = 'pswp-item-container'>
<img id = "live-photo-image-${file.id}" src="${imageURL}" />
<video id = "live-photo-video-${file.id}" loop muted>
<img id = "live-photo-image-${file.id}" src="${imageURL}" onContextMenu="return false;"/>
<video id = "live-photo-video-${file.id}" loop muted onContextMenu="return false;">
<source src="${videoURL}" />
Your browser does not support the video tag.
</video>
@ -335,7 +335,7 @@ const PhotoFrame = ({
} else {
file.html = `
<div class="pswp-item-container">
<img src="${file.msrc}" />
<img src="${file.msrc}" onContextMenu="return false;"/>
<div class="download-banner">
${constants.VIDEO_PLAYBACK_FAILED_DOWNLOAD_INSTEAD}
<button class = "btn btn-outline-success" id = "download-btn-${file.id}">Download</button>