From 4907bcba103c020dfe97152b5e193139991d45aa Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 1 Nov 2024 22:56:36 -0400 Subject: [PATCH] initialize Window.DialogCount and improve TitleElement selecting --- lib/phast/client/scripts/controls/Window.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/phast/client/scripts/controls/Window.js b/lib/phast/client/scripts/controls/Window.js index bfa7590..b25372c 100644 --- a/lib/phast/client/scripts/controls/Window.js +++ b/lib/phast/client/scripts/controls/Window.js @@ -7,6 +7,7 @@ function Window(parentElement) if (!parentElement) { parentElement = document.createElement("div"); + parentElement.NativeObject = this; parentElement.className = "uwt-window"; var titleBar = document.createElement("div"); @@ -31,6 +32,7 @@ function Window(parentElement) document.body.appendChild(parentElement); } this.ParentElement = parentElement; + this.TitleElement = this.ParentElement.children[0].children[0]; this.mvarContentURL = null; /** @@ -179,7 +181,7 @@ function Window(parentElement) */ this.GetTitle = function() { - return this.ParentElement.childNodes[0].childNodes[0].innerHTML; + return this.TitleElement.innerHTML; }; /** * Sets the title of this Window. @@ -187,7 +189,7 @@ function Window(parentElement) */ this.SetTitle = function(title) { - this.ParentElement.childNodes[0].childNodes[0].innerHTML = title; + this.TitleElement.innerHTML = title; }; /** @@ -303,6 +305,11 @@ function Window(parentElement) }; this.ShowDialog = function() { + if (typeof(Window.DialogCount) == 'undefined') + { + Window.DialogCount = 0; + } + Window.DialogCount++; if (Window.ModalBackgroundElement == null)