From 945fb610f9acf17513ac22345a2a9024f424b086 Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Sun, 28 Dec 2025 21:13:02 -0700 Subject: [PATCH] Fix: Prevent drag-drop overlay during internal reordering in Media Manager Updated drag event listeners in MediaManager.html to check for 'Files' in dataTransfer.types. This ensures the upload overlay only appears when files are dragged from the OS, preventing interference with SortableJS reordering. --- src/MediaManager.html | 79 +++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/src/MediaManager.html b/src/MediaManager.html index 2de00a6..0b5ac1a 100644 --- a/src/MediaManager.html +++ b/src/MediaManager.html @@ -716,17 +716,13 @@ badge = 'Deleted'; } - // Check Video var isVideo = (item.mimeType && item.mimeType.startsWith('video/')) || (item.filename && item.filename.match(/\.(mp4|mov|webm)$/i)); if (isVideo) console.log("[MediaManager] Video Detected: " + item.filename); - var videoBadgeIcon = isVideo ? '
📹
' : ''; + var videoBadgeIcon = isVideo ? '
đŸŽžī¸
' : ''; - // Content URL - var contentUrl = item.contentUrl || ""; - if (isVideo && item.source !== 'shopify_only' && state.token) { - contentUrl = "https://www.googleapis.com/drive/v3/files/" + item.id + "?alt=media&access_token=" + state.token; - } + // content URL logic (Only relevant for Shopify where we have a direct public link) + var contentUrl = item.contentUrl || ""; var actionBtn = item._deleted ? '' @@ -740,16 +736,19 @@ actionBtn + ''; - // Create Media Element Programmatically + // Create Media Element + // RULE: Only create