:: Forum >> Version 2 >>

popup state

is there a way to find out whether a popup template is currently showing or hiding. I've tried typeof(obj.getPopupTemplate().$popup) =="undefined"?"hidden":"visible"  but no cigar.
Dmitry
Wednesday, January 4, 2006
I have never used this template but looking at your code I would have guessed it wouldn't work. Try this:
obj.getPopupTemplate().getStyle("visibility");  or

obj.getPopupTemplate().getStyle("display" one of these might reveal hidden vs visible. The Display property is either empty (visible) or "none" (hidden)
Jim Hunter
Wednesday, January 4, 2006
Jim, your code woulnd't work either. Here's how the popup template is implemented:

AW.Templates.Popup AW.System.Template.subclass();

AW.Templates.Popup.create = function(){

    var 
obj this.prototype;

    
obj.setClass("popup""normal");

    
obj.showPopup = function(){

        var 
popup window.createPopup();
        
this.$popup popup;

        var 
doc popup.document;
        
doc.open();

        
AW.register(doc.parentWindow);

        if (
AW.strict){
            
doc.write("<!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01\/\/EN\" \"http:\/\/www.w3.org/TR/html4/strict.dtd\">");
        }

        var 
cls document.getElementsByTagName("html")[0].className;

        
doc.write("<html class=\"aw-popup-window aw-system-control " cls "\"><head>");

        for (var 
i=0i<document.styleSheets.lengthi++){
            
doc.write(document.styleSheets[i].owningElement.outerHTML);
        }
                          
// [...]
 
Dmitry
Sunday, January 8, 2006
d'oh! i just answered my own question. The code should be:

typeof(obj.$popup) =="undefined"?"hidden":"visible"    thanks for the spark :)
Dmitry
Sunday, January 8, 2006



This topic is archived.

Back to support forum

Forum search