aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-03-07 10:59:36 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-03-07 10:59:36 +0200
commit708b31b629ba9df642417bc254e7f7c2ea70c865 (patch)
treeb79ceb89a91cb16f423012f5820300522e591c51
parent10a9aa16bb7cfd74e360a183222d8a71d3a52574 (diff)
downloadfileup-708b31b629ba9df642417bc254e7f7c2ea70c865.tar.gz
Actions part 4 of N, iframes disabled while dragging
-rw-r--r--loggedin.js8
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();