1
0
mirror of https://github.com/vladmandic/sdnext.git synced 2026-01-27 15:02:48 +03:00
Files
sdnext/javascript/control.js
Vladimir Mandic 86af00ce36 control prep work
2023-12-16 13:25:25 -05:00

17 lines
567 B
JavaScript

function setupControlUI() {
const tabs = ['input', 'output', 'preview'];
for (const tab of tabs) {
const btn = gradioApp().getElementById(`control-${tab}-button`);
btn.style.cursor = 'pointer';
btn.onclick = () => {
const t = gradioApp().getElementById(`control-tab-${tab}`);
t.style.display = t.style.display === 'none' ? 'block' : 'none';
const c = gradioApp().getElementById(`control-${tab}-column`);
c.style.flexGrow = c.style.flexGrow === '0' ? '9' : '0';
};
}
log('initControlUI');
}
onUiLoaded(setupControlUI);