Restore pane resizing
This commit is contained in:
parent
dee6dd8cd8
commit
cc3f796ca3
2 changed files with 25 additions and 21 deletions
14
frontend-js/dist/app.js
vendored
14
frontend-js/dist/app.js
vendored
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue