ASPxClientLoadingPanel = _aspxCreateClass(ASPxClientControl, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.containerElementID = ""; this.containerElement = null; this.horizontalOffset = 0; this.verticalOffset = 0; this.isTextEmpty = false; this.showImage = true; this.shown = false; this.currentoffsetElement = null; this.currentX = null; this.currentY = null; }, Initialize: function(){ if(this.containerElementID != "") this.containerElement = _aspxGetElementById(this.containerElementID); this.constructor.prototype.Initialize.call(this); }, SetCurrentShowArguments: function(offsetElement, x, y){ if(offsetElement == null) offsetElement = this.containerElement; if(offsetElement && !_aspxIsValidElement(offsetElement)) offsetElement = _aspxGetElementById(offsetElement.id); if(offsetElement == null) offsetElement = document.body; this.currentoffsetElement = offsetElement; this.currentX = x; this.currentY = y; }, ResetCurrentShowArguments: function(){ this.currentoffsetElement = null; this.currentX = null; this.currentY = null; }, SetLoadingPanelPosAndSize: function(){ var element = this.GetMainElement(); this.SetLoadingPanelLocation( this.currentoffsetElement, element, this.currentX, this.currentY, this.horizontalOffset, this.verticalOffset); }, SetLoadingDivPosAndSize: function(){ var element = this.GetLoadingDiv(); if(element != null){ _aspxSetElementDisplay(element, true); this.SetLoadingDivBounds(this.currentoffsetElement, element); } }, ShowInternal: function(offsetElement, x, y){ this.SetCurrentShowArguments(offsetElement, x, y); var element = this.GetMainElement(); _aspxSetElementDisplay(element, true); this.SetLoadingPanelPosAndSize(); this.SetLoadingDivPosAndSize(); this.shown = true; }, Show: function(){ this.ShowInternal(null); }, ShowInElement: function(htmlElement){ if(htmlElement) this.ShowInternal(htmlElement); }, ShowInElementByID: function(id){ var htmlElement = _aspxGetElementById(id); this.ShowInElement(htmlElement); }, ShowAtPos: function(x, y){ this.ShowInternal(null, x, y); }, SetText: function(text){ this.isTextEmpty = (text == null || text == ""); var textLabel = this.GetTextLabel(); if(textLabel) textLabel.innerHTML = this.isTextEmpty ? " " : text; }, GetText: function() { return this.isTextEmpty ? "" : this.GetTextLabel().innerHTML; }, Hide: function(){ var element = this.GetMainElement(); _aspxSetElementDisplay(element, false); element = this.GetLoadingDiv(); if(element != null) { _aspxSetStyles(element, { width: 1, height: 1 }); _aspxSetElementDisplay(element, false); } this.ResetCurrentShowArguments(); this.shown = false; }, GetTextLabel: function(){ return this.GetChild("_TL"); }, GetVisible: function(){ return _aspxGetElementDisplay(this.GetMainElement()); }, SetVisible: function(visible){ if(visible && !this.IsVisible()) this.Show(); else if(!visible && this.IsVisible()) this.Hide(); }, BrowserWindowResizeSubscriber: function() { return true; }, OnBrowserWindowResize: function(){ if(this.shown){ this.SetLoadingPanelPosAndSize(); this.SetLoadingDivPosAndSize(); } } }); ASPxClientLoadingPanel.Cast = ASPxClientControl.Cast;