Commit afbb0b5f authored by Aarni Koskela's avatar Aarni Koskela

Zoom and Pan: simplify getElements (it's not actually async)

parent 68cda4f2
...@@ -143,16 +143,10 @@ onUiLoaded(async() => { ...@@ -143,16 +143,10 @@ onUiLoaded(async() => {
let mouseX, mouseY; let mouseX, mouseY;
let activeElement; let activeElement;
async function getElements() { const elements = Object.fromEntries(Object.keys(elementIDs).map((id) => [
const elements = await Promise.all( id,
Object.values(elementIDs).map(id => gradioApp().querySelector(id)) gradioApp().querySelector(elementIDs[id]),
); ]));
return Object.fromEntries(
Object.keys(elementIDs).map((key, index) => [key, elements[index]])
);
}
const elements = await getElements();
const elemData = {}; const elemData = {};
// Apply functionality to the range inputs. Restore redmask and correct for long images. // Apply functionality to the range inputs. Restore redmask and correct for long images.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment