From 708b31b629ba9df642417bc254e7f7c2ea70c865 Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Sun, 7 Mar 2021 10:59:36 +0200 Subject: Actions part 4 of N, iframes disabled while dragging --- loggedin.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/loggedin.js b/loggedin.js index b7b0f0e..aa40843 100644 --- a/loggedin.js +++ b/loggedin.js @@ -551,6 +551,7 @@ function begin_drag_fileview(e, fileview) { // Start dragging the 'obj' DOM element // e is a DOM event, this should only get called in response of a DOM event function begin_drag(e, obj, dont_set_width) { + set_iframe_enabled(false); dragging = obj; dragging_candidate = null; dragging.classList.add("dragged"); @@ -575,6 +576,8 @@ function begin_drag(e, obj, dont_set_width) { } function end_drag(_e) { + set_iframe_enabled(true); + // If there's a dragging palceholder remove it and put the dragged node back into its place if (dragging_placeholder) { dragging_placeholder.parentNode.insertBefore(dragging, dragging_placeholder); @@ -1132,4 +1135,9 @@ document.body.oncontextmenu = (e) => { the_file.onchange = (e) => { on_file_added(e); }; +function set_iframe_enabled(en) { + for (const iframe of document.getElementsByTagName('iframe')) + iframe.hidden = !en; +} + main(); -- cgit v1.2.3