Skip to content

Commit

Permalink
Should avoid opening the upload overlay when draging html element (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Nov 12, 2020
1 parent d365cfc commit dd5183d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/js/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,20 @@ export function prepare_drop_section() {
elem.addEventListener('dragenter', (e) => {
e.preventDefault(); e.stopPropagation();
if (document.body.classList.contains('no-drop')) return;
if (
e.relatedTarget
&& e.relatedTarget.nodeType
) return;
document.getElementById('overlay_drop').style.display = '';
});

elem.addEventListener('dragover', (e) => {
e.preventDefault(); e.stopPropagation();
if (document.body.classList.contains('no-drop')) return;
if (
e.relatedTarget
&& e.relatedTarget.nodeType
) return;
if (timeout) {
clearTimeout(timeout);
timeout = setTimeout(() => {
Expand Down

0 comments on commit dd5183d

Please sign in to comment.