From 13fbacdf4bc66dd9f4b25b81aef18ca43f3eedc7 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Tue, 21 Apr 2026 12:43:37 +0200 Subject: [PATCH] Attach drag handle events for Linker dialog Add attachDragHandleIfNeeded() and call it when opening the dialog. The new helper binds a single mousedown listener on #model-linker-drag-handle (and a one-time document mouseup) to start dragging, set cursor state, and avoid attaching multiple times. It also skips drag behavior in fullscreen and safely no-ops if the handle element is missing. --- web/linker.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/web/linker.js b/web/linker.js index 3ca6f67..a1ae8d8 100644 --- a/web/linker.js +++ b/web/linker.js @@ -1785,10 +1785,33 @@ class LinkerManagerDialog extends ComfyDialog { if (fs === '1') this.setFullScreen(true); } catch (e) { } + // Attach drag handle event listener (only once) + this.attachDragHandleIfNeeded(); + // Use provided workflow or fetch from current graph await this.loadWorkflowData(workflow); } + // Attach drag handle event listeners + attachDragHandleIfNeeded() { + if (this._dragHandleAttached) return; + + const handle = document.getElementById('model-linker-drag-handle'); + if (!handle) return; + + const onMouseDown = (e) => { + if (this.fullscreen) return; // no drag in fullscreen + handle.style.cursor = 'grabbing'; + this.startDrag(e); + }; + const onMouseUp = () => { handle.style.cursor = 'grab'; }; + + handle.addEventListener('mousedown', onMouseDown); + document.addEventListener('mouseup', onMouseUp, { once: true }); + + this._dragHandleAttached = true; + } + close() { this._hidePreview?.(); this.backdrop.style.display = "none";