From c24e6029cef707069bf601724e1164760289e6f9 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Thu, 7 Apr 2022 18:50:14 -0600 Subject: [PATCH] fixed a couple issues with window object references --- libs/blueui.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/blueui.js b/libs/blueui.js index d7019f4..3f909e3 100644 --- a/libs/blueui.js +++ b/libs/blueui.js @@ -120,11 +120,11 @@ class buiWindow { this.controls = document.createElement("span"); this.controls.setAttribute("class","bui_window_controls"); if (min) { - this.minimizeButton = new buiButton("_",this.minimize); + this.minimizeButton = new buiButton("_",() => { this.minimize() }); this.controls.appendChild(this.minimizeButton.root); } if (close) { - this.closeButton = new buiButton("X",this.close); + this.closeButton = new buiButton("X",() => { this.close(); }); this.controls.appendChild(this.closeButton.root) } this.titlebar.appendChild(this.controls); @@ -146,9 +146,13 @@ class buiWindow { } minimize () { + var current = this.content.style.display == "none" ? "revert" : "none"; + this.content.style.display = current; } close () { + this.root.remove(); + // this = undefined; } }