enable full resize opts in hires

This commit is contained in:
Vladimir Mandic
2024-09-08 12:32:45 -04:00
parent 51e8567eec
commit a92e1ce664
19 changed files with 88 additions and 60 deletions
+16 -14
View File
@@ -421,21 +421,23 @@ function setupExtraNetworksForTab(tabname) {
// card hover
let hoverTimer = null;
let previousCard = null;
gradioApp().getElementById(`${tabname}_extra_tabs`).onmouseover = (e) => {
const el = e.target.closest('.card'); // bubble-up to card
if (!el || (el.title === previousCard)) return;
if (!hoverTimer) {
hoverTimer = setTimeout(() => {
readCardDescription(el.dataset.page, el.dataset.name);
readCardTags(el, el.dataset.tags);
previousCard = el.title;
}, 300);
}
el.onmouseout = () => {
clearTimeout(hoverTimer);
hoverTimer = null;
if (window.opts.extra_networks_fetch) {
gradioApp().getElementById(`${tabname}_extra_tabs`).onmouseover = async (e) => {
const el = e.target.closest('.card'); // bubble-up to card
if (!el || (el.title === previousCard)) return;
if (!hoverTimer) {
hoverTimer = setTimeout(() => {
readCardDescription(el.dataset.page, el.dataset.name);
readCardTags(el, el.dataset.tags);
previousCard = el.title;
}, 300);
}
el.onmouseout = () => {
clearTimeout(hoverTimer);
hoverTimer = null;
};
};
};
}
// en style
if (!en) return;
+1 -1
View File
@@ -17,7 +17,6 @@ async function initStartup() {
initImageViewer();
initGallery();
setupControlUI();
setupExtraNetworks();
// reconnect server session
await reconnectUI();
@@ -25,6 +24,7 @@ async function initStartup() {
// make sure all of the ui is ready and options are loaded
while (Object.keys(window.opts).length === 0) await sleep(50);
executeCallbacks(uiReadyCallbacks);
setupExtraNetworks();
// optinally wait for modern ui
if (window.waitForUiReady) await waitForUiReady();