Updates
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user