mirror of
https://github.com/vladmandic/automatic
synced 2026-09-17 16:24:33 +02:00
add compact view
This commit is contained in:
@@ -370,6 +370,21 @@ function create_theme_element() {
|
||||
return el;
|
||||
}
|
||||
|
||||
function toggleCompact(val) {
|
||||
log('toggleCompact', val);
|
||||
if (val) {
|
||||
gradioApp().style.setProperty('--layout-gap', 'var(--spacing-md)');
|
||||
gradioApp().querySelectorAll('input[type=range]').forEach((el) => el.classList.add('hidden'));
|
||||
gradioApp().querySelectorAll('div .form').forEach((el) => el.classList.add('form-compact'));
|
||||
gradioApp().querySelectorAll('.small-accordion .label-wrap').forEach((el) => el.classList.add('accordion-compact'));
|
||||
} else {
|
||||
gradioApp().style.setProperty('--layout-gap', 'var(--spacing-xxl)');
|
||||
gradioApp().querySelectorAll('input[type=range]').forEach((el) => el.classList.remove('hidden'));
|
||||
gradioApp().querySelectorAll('div .form').forEach((el) => el.classList.remove('form-compact'));
|
||||
gradioApp().querySelectorAll('.small-accordion .label-wrap').forEach((el) => el.classList.remove('accordion-compact'));
|
||||
}
|
||||
}
|
||||
|
||||
function previewTheme() {
|
||||
let name = gradioApp().getElementById('setting_gradio_theme').querySelectorAll('input')?.[0].value || '';
|
||||
fetch('/file=html/themes.json').then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user