From 1126392c15921f28026b7f3ba2ee34dd389efe58 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Tue, 20 Dec 2022 11:57:25 -0700 Subject: [PATCH] Changed conditions for allowing focus windows --- libs/blueui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/blueui.js b/libs/blueui.js index 9887cc0..35efd2b 100644 --- a/libs/blueui.js +++ b/libs/blueui.js @@ -118,7 +118,6 @@ class buiWindow { draggable = "boolean" == typeof draggable ? draggable : true; if (draggable) { makeDraggable(this.root, this.titlebar); - this.root.addEventListener("click", this.focus, {useCapture: true}); } min = "boolean" == typeof min ? min : false; close = "boolean" == typeof close ? close : false; @@ -151,6 +150,9 @@ class buiWindow { } this.root.appendChild(this.titlebar); this.root.appendChild(this.main); + if (draggable || min || close) { + this.root.addEventListener("click", this.focus, {useCapture: true}); + } } focus () { focus_window(this); }