Merge pull request #15288 from light-and-ray/allow_use_zoom.js_outside_webui_context

little fixes zoom.js
This commit is contained in:
AUTOMATIC1111 2024-03-17 09:48:33 +03:00 committed by GitHub
commit c95c46004a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -280,7 +280,7 @@ onUiLoaded(async() => {
const targetElement = gradioApp().querySelector(elemId); const targetElement = gradioApp().querySelector(elemId);
if (!targetElement) { if (!targetElement) {
console.log("Element not found"); console.log("Element not found", elemId);
return; return;
} }
@ -939,9 +939,9 @@ onUiLoaded(async() => {
} }
elementIDs.sketch && applyZoomAndPan(elementIDs.sketch, false); applyZoomAndPan(elementIDs.sketch, false);
elementIDs.inpaint && applyZoomAndPan(elementIDs.inpaint, false); applyZoomAndPan(elementIDs.inpaint, false);
elementIDs.inpaintSketch && applyZoomAndPan(elementIDs.inpaintSketch, false); applyZoomAndPan(elementIDs.inpaintSketch, false);
// Make the function global so that other extensions can take advantage of this solution // Make the function global so that other extensions can take advantage of this solution
const applyZoomAndPanIntegration = async(id, elementIDs) => { const applyZoomAndPanIntegration = async(id, elementIDs) => {