mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
Merge pull request #4149 from CalamitousFelicitousness/patch-3
extraNetworks.js fix for networks menu with process caption gallery tabs
This commit is contained in:
@@ -14,8 +14,13 @@ const getENActiveTab = () => {
|
||||
else if (gradioApp().getElementById('extras_image')?.checkVisibility()) tabName = 'process';
|
||||
else if (gradioApp().getElementById('interrogate_image')?.checkVisibility()) tabName = 'caption';
|
||||
else if (gradioApp().getElementById('tab-gallery-search')?.checkVisibility()) tabName = 'gallery';
|
||||
if (tabName in ['process', 'caption', 'gallery']) tabName = lastTab;
|
||||
else lastTab = tabName;
|
||||
|
||||
if (['process', 'caption', 'gallery'].includes(tabName)) {
|
||||
tabName = lastTab;
|
||||
} else if (tabName !== '') {
|
||||
lastTab = tabName;
|
||||
}
|
||||
|
||||
if (tabName !== '') return tabName;
|
||||
// legacy method
|
||||
if (gradioApp().getElementById('tab_txt2img')?.style.display === 'block') tabName = 'txt2img';
|
||||
@@ -277,8 +282,12 @@ function extraNetworksSearchButton(event) {
|
||||
const tabName = getENActiveTab();
|
||||
const searchTextarea = gradioApp().querySelector(`#${tabName}_extra_search textarea`);
|
||||
const button = event.target;
|
||||
searchTextarea.value = `${button.textContent.trim()}/`;
|
||||
updateInput(searchTextarea);
|
||||
if (searchTextarea) {
|
||||
searchTextarea.value = `${button.textContent.trim()}/`;
|
||||
updateInput(searchTextarea);
|
||||
} else {
|
||||
console.error(`Could not find the search textarea for the tab: ${tabName}`);
|
||||
}
|
||||
}
|
||||
|
||||
let desiredStyle = '';
|
||||
|
||||
Reference in New Issue
Block a user