mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-01-26 19:09:45 +00:00
Update dragdrop.js
remove unnecessary check for PNGInfo element enables repeated drag-drop into PNG Info fixes https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1485
This commit is contained in:
21
javascript/dragdrop.js
vendored
21
javascript/dragdrop.js
vendored
@@ -26,26 +26,7 @@ function dropReplaceImage(imgWrap, files) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (imgWrap.closest('#pnginfo_image')) {
|
window.requestAnimationFrame(() => callback());
|
||||||
// special treatment for PNG Info tab, wait for fetch request to finish
|
|
||||||
const oldFetch = window.fetch;
|
|
||||||
window.fetch = async(input, options) => {
|
|
||||||
const response = await oldFetch(input, options);
|
|
||||||
if ('api/predict/' === input) {
|
|
||||||
const content = await response.text();
|
|
||||||
window.fetch = oldFetch;
|
|
||||||
window.requestAnimationFrame(() => callback());
|
|
||||||
return new Response(content, {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
headers: response.headers
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
window.requestAnimationFrame(() => callback());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventHasFiles(e) {
|
function eventHasFiles(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user