aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorConnum <connum@gmail.com>2022-09-20 23:57:11 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-21 06:13:13 +0000
commitb5693699b8460008ca92544b42f6bc394078ee4d (patch)
treefa5e58a423da222c29491307c74056259efd6364 /javascript
parente9ba2d42d6c13bc3f8763c6ccd00fff2519b3152 (diff)
downloadstable-diffusion-webui-gfx803-b5693699b8460008ca92544b42f6bc394078ee4d.tar.gz
stable-diffusion-webui-gfx803-b5693699b8460008ca92544b42f6bc394078ee4d.tar.bz2
stable-diffusion-webui-gfx803-b5693699b8460008ca92544b42f6bc394078ee4d.zip
Revert "Reset image input when dragover new image"
This reverts commit 9035afbab5e1285cfc7ad39c1e17374973842ae9.
Diffstat (limited to 'javascript')
-rw-r--r--javascript/dragdrop.js17
1 files changed, 1 insertions, 16 deletions
diff --git a/javascript/dragdrop.js b/javascript/dragdrop.js
index 0fb74dba..c01f66e2 100644
--- a/javascript/dragdrop.js
+++ b/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 => {
const target = e.composedPath()[0];
const imgWrap = target.closest('[data-testid="image"]');
@@ -57,13 +48,7 @@ window.document.addEventListener('dragover', e => {
}
e.stopPropagation();
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 => {