diff options
author | Alex Vitkov <alexvitkov98@gmail.com> | 2021-03-07 10:59:36 +0200 |
---|---|---|
committer | Alex Vitkov <alexvitkov98@gmail.com> | 2021-03-07 10:59:36 +0200 |
commit | 708b31b629ba9df642417bc254e7f7c2ea70c865 (patch) | |
tree | b79ceb89a91cb16f423012f5820300522e591c51 | |
parent | 10a9aa16bb7cfd74e360a183222d8a71d3a52574 (diff) | |
download | fileup-708b31b629ba9df642417bc254e7f7c2ea70c865.tar.gz |
Actions part 4 of N, iframes disabled while dragging
-rw-r--r-- | loggedin.js | 8 |
1 files changed, 8 insertions, 0 deletions
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(); |