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;