This commit is contained in:
2026-03-06 11:11:08 +02:00
parent f580775cc2
commit 5994e165c6
3 changed files with 75 additions and 22 deletions

View File

@@ -12,6 +12,10 @@
let floatingWindowZ = 80;
let windowLayouts = {};
function isMobileViewport() {
return window.matchMedia('(max-width: 899px)').matches;
}
function applyTheme(theme) {
const normalized = theme || DEFAULT_THEME;
document.documentElement.setAttribute('data-ui-theme', normalized);
@@ -164,6 +168,12 @@
if (!id) {
return;
}
if (isMobileViewport()) {
windowEl.style.right = 'auto';
windowEl.style.bottom = 'auto';
windowEl.style.transform = 'none';
return;
}
const defaults = DEFAULT_WINDOW_LAYOUTS[id];
const saved = windowLayouts[id];
const normalized = normalizeLayout(saved, defaults);
@@ -208,6 +218,9 @@
if (!windowEl || windowEl.classList.contains('hidden')) {
return;
}
if (isMobileViewport()) {
return;
}
bringWindowToFront(windowEl);
const rect = windowEl.getBoundingClientRect();
@@ -269,6 +282,9 @@
if (windowEl.classList.contains('hidden')) {
return;
}
if (isMobileViewport()) {
return;
}
persistWindowLayout(windowEl);
});
});
@@ -285,6 +301,9 @@
});
window.addEventListener('resize', () => {
if (isMobileViewport()) {
return;
}
document.querySelectorAll('.ui-tool-window').forEach((windowEl) => {
const id = windowEl.id;
if (!id) {