Переглянути джерело

Revert "Reset image input when dragover new image"

This reverts commit 9035afbab5e1285cfc7ad39c1e17374973842ae9.
Connum 2 роки тому
батько
коміт
b5693699b8
1 змінених файлів з 1 додано та 16 видалено
  1. 1 16
      javascript/dragdrop.js

+ 1 - 16
javascript/dragdrop.js

@@ -40,15 +40,6 @@ function dropReplaceImage( imgWrap, files ) {
     }
     }
 }
 }
 
 
-function pressClearBtn(hoverElems) {
-    //Find all buttons hovering over the image box
-    let btns = Array.from(hoverElems.querySelectorAll("button"))
-
-    //Press the last btn which will be the X button
-    if (btns.length)
-        btns[btns.length-1].click()
-}
-
 window.document.addEventListener('dragover', e => {
 window.document.addEventListener('dragover', e => {
     const target = e.composedPath()[0];
     const target = e.composedPath()[0];
     const imgWrap = target.closest('[data-testid="image"]');
     const imgWrap = target.closest('[data-testid="image"]');
@@ -57,13 +48,7 @@ window.document.addEventListener('dragover', e => {
     }
     }
     e.stopPropagation();
     e.stopPropagation();
     e.preventDefault();
     e.preventDefault();
-
-    if (e.dataTransfer) 
-         e.dataTransfer.dropEffect = 'copy';   
-        
-    //If is gr.Interface clear image on hover
-    if (target.previousElementSibling)
-        pressClearBtn(target.previousElementSibling)
+    e.dataTransfer.dropEffect = 'copy';
 });
 });
 
 
 window.document.addEventListener('drop', e => {
 window.document.addEventListener('drop', e => {