Restore pane resizing

This commit is contained in:
DonVoo 2026-07-13 11:39:15 +02:00
parent dee6dd8cd8
commit cc3f796ca3
2 changed files with 25 additions and 21 deletions

View file

@ -83,9 +83,10 @@
function move(moveEvent) {
const delta = moveEvent.clientX - startX;
const next = start.slice();
const left = Math.max(minWidths[index], start[index] + delta);
const mins = minWidths(container);
const left = Math.max(mins[index], start[index] + delta);
const used = left - start[index];
const right = Math.max(minWidths[index + 1], start[index + 1] - used);
const right = Math.max(mins[index + 1], start[index + 1] - used);
const actual = start[index + 1] - right;
next[index] = start[index] + actual;
next[index + 1] = right;
@ -106,9 +107,12 @@
});
}
window.addEventListener("DOMContentLoaded", () => bind(document.querySelector(".transfer-workbench")));
window.addEventListener("DOMContentLoaded", () => bind(document.querySelector(".four-pane")));
window.addEventListener("DOMContentLoaded", () => bind(document.querySelector(".three-pane")));
function bindAll() {
document.querySelectorAll(".transfer-workbench, .four-pane, .three-pane").forEach(bind);
}
window.addEventListener("DOMContentLoaded", bindAll);
document.addEventListener("htmx:afterSwap", bindAll);
})();
(function () {