css fixes

This commit is contained in:
Vladimir Mandic
2023-08-29 16:15:12 -04:00
parent 10f345f09b
commit fd57787557
5 changed files with 9 additions and 18 deletions
+2 -3
View File
@@ -97,15 +97,14 @@ function setupExtraNetworks() {
function registerPrompt(tabname, id) {
const textarea = gradioApp().querySelector(`#${id} > label > textarea`);
if (!activePromptTextarea[tabname]) activePromptTextarea[tabname] = textarea;
textarea.addEventListener('focus', () => {
activePromptTextarea[tabname] = textarea;
});
textarea.addEventListener('focus', () => { activePromptTextarea[tabname] = textarea; });
}
registerPrompt('txt2img', 'txt2img_prompt');
registerPrompt('txt2img', 'txt2img_neg_prompt');
registerPrompt('img2img', 'img2img_prompt');
registerPrompt('img2img', 'img2img_neg_prompt');
log('initExtraNetworks');
}
onUiLoaded(setupExtraNetworks);
+3 -12
View File
@@ -138,27 +138,18 @@ onUiLoaded(() => {
const observer = new MutationObserver((mutations) => {
const show_all_pages_dummy = gradioApp().getElementById('settings_show_all_pages');
if (show_all_pages_dummy.style.display === 'none') { return; }
function mutation_on_style(mut) {
return mut.type === 'attributes' && mut.attributeName === 'style';
}
if (mutations.some(mutation_on_style)) {
showAllSettings();
}
const mutation_on_style = (mut) => mut.type === 'attributes' && mut.attributeName === 'style';
if (mutations.some(mutation_on_style)) showAllSettings();
});
const tab_content_wrapper = document.createElement('div');
tab_content_wrapper.className = 'tab-content';
tab_nav_element.parentElement.insertBefore(tab_content_wrapper, tab_nav_element.nextSibling);
tab_elements.forEach((elem, index) => {
// Move the modification indicator to the toplevel tab button
const tab_name = elem.id.replace('settings_', '');
const indicator = gradioApp().getElementById(`modification_indicator_${tab_name}`);
tab_nav_element.insertBefore(indicator, tab_nav_buttons[index]);
// Add the tab content to the wrapper
tab_content_wrapper.appendChild(elem);
// Add the mutation observer to the tab element
observer.observe(elem, { attributes: true, attributeFilter: ['style'] });
});
log('initSettings');
});
+2 -1
View File
@@ -113,13 +113,14 @@ div#extras_scale_to_tab div.form{ flex-direction: row; }
.tooltip-show { opacity: 0.9; }
/* settings */
.licenses { display: block !important; }
#quicksettings { width: fit-content; align-items: end; }
#quicksettings > div, #quicksettings > fieldset{ max-width: 20em; min-width: 24em; padding: 0; border: none; box-shadow: none; background: none; }
#quicksettings > button { margin-left: -0.5em; }
#settings { display: flex; gap: var(--layout-gap); }
#settings div { border: none; display: inline-flex; justify-content: normal; }
#settings > div.tab-content { flex: 10 0 75%; }
#settings > div.tab-content { flex: 10 0 75%; display: grid; }
#settings > div.tab-content > div { border: none; padding: 0; }
#settings > div.tab-content > div > div > div > div > div { flex-direction: unset; }