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); }