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)