|
|
@@ -696,8 +696,7 @@ function makeWin({ id, title, short, x, y, w, h, bodyHtml, onClosed, extraCls, r
|
|
|
front(win);
|
|
|
const ox = win.offsetLeft, oy = win.offsetTop; // baseline — read ONCE
|
|
|
drag(
|
|
|
- e.clientX,
|
|
|
- e.clientY,
|
|
|
+ e,
|
|
|
(dx, dy) => {
|
|
|
win.style.left = Math.max(0, ox + dx) + "px";
|
|
|
win.style.top = Math.max(0, oy + dy) + "px";
|
|
|
@@ -710,8 +709,7 @@ function makeWin({ id, title, short, x, y, w, h, bodyHtml, onClosed, extraCls, r
|
|
|
front(win);
|
|
|
const ow = win.offsetWidth, oh = win.offsetHeight; // baseline — read ONCE
|
|
|
drag(
|
|
|
- e.clientX,
|
|
|
- e.clientY,
|
|
|
+ e,
|
|
|
(dx, dy) => {
|
|
|
win.style.width = Math.max(240, ow + dx) + "px";
|
|
|
win.style.height = Math.max(140, oh + dy) + "px";
|
|
|
@@ -751,16 +749,30 @@ function makeWin({ id, title, short, x, y, w, h, bodyHtml, onClosed, extraCls, r
|
|
|
return handle;
|
|
|
}
|
|
|
|
|
|
-function drag(sx, sy, move, done) {
|
|
|
- const st = { x: sx, y: sy };
|
|
|
- const mv = (e) => move(e.clientX - st.x, e.clientY - st.y);
|
|
|
- const up = () => {
|
|
|
+// Pointer-drag with POINTER CAPTURE on the element that received the
|
|
|
+// pointerdown. Without it a drag that crosses another window's <iframe>
|
|
|
+// (the recipes panel is one) dies on the first move: the iframe becomes the
|
|
|
+// event target and the parent document never sees pointermove again — the
|
|
|
+// log window opened ON TOP of the recipes window could only be shrunk, never
|
|
|
+// grown (2026-10-21). Capture retargets every move back to the dragged
|
|
|
+// element, so the drag survives the iframe and leaving the browser window.
|
|
|
+function drag(e0, move, done) {
|
|
|
+ const st = { x: e0.clientX, y: e0.clientY };
|
|
|
+ const el = e0.currentTarget;
|
|
|
+ const pid = e0.pointerId;
|
|
|
+ const mv = (e) => { if (e.pointerId === pid) move(e.clientX - st.x, e.clientY - st.y); };
|
|
|
+ const up = (e) => {
|
|
|
+ if (e && e.pointerId !== pid) return;
|
|
|
removeEventListener("pointermove", mv);
|
|
|
removeEventListener("pointerup", up);
|
|
|
+ removeEventListener("pointercancel", up);
|
|
|
+ try { if (el && el.hasPointerCapture?.(pid)) el.releasePointerCapture(pid); } catch {}
|
|
|
if (done) done();
|
|
|
};
|
|
|
+ try { el?.setPointerCapture?.(pid); } catch {}
|
|
|
addEventListener("pointermove", mv);
|
|
|
addEventListener("pointerup", up);
|
|
|
+ addEventListener("pointercancel", up);
|
|
|
}
|
|
|
|
|
|
function renderDock() {
|