From 4df6463506841656e45ac8434a67d97b36596392 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 1 Jan 2024 19:08:26 +0000 Subject: [PATCH] dont show the custom popup when fullscreen --- css/app.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/css/app.js b/css/app.js index cf5c440a..204802d0 100644 --- a/css/app.js +++ b/css/app.js @@ -285,14 +285,21 @@ function fetchUrls(urls) { var popupMenu = document.getElementById("popupMenu"); var loopOption = document.getElementById("loopOption"); var speedOption = document.getElementById("speedOption"); + - video.addEventListener("contextmenu", function(event) { - event.preventDefault(); +video.addEventListener("contextmenu", function(event) { + // Check if the video is in fullscreen mode + if (!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement) { + // The video is not in fullscreen mode, prevent the default behavior + event.preventDefault(); + + // Your additional context menu logic + popupMenu.style.display = "block"; + popupMenu.style.left = event.pageX + "px"; + popupMenu.style.top = event.pageY + "px"; + } +}); - popupMenu.style.display = "block"; - popupMenu.style.left = event.pageX + "px"; - popupMenu.style.top = event.pageY + "px"; - }); // Hide the popup menu when clicking outside of it window.addEventListener("click", function(event) {