Ignore:
Timestamp:
03/11/10 15:57:41 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #941 - Correcao dos templates na parte de configuracao para o navegador IE8.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/js/makeW.js

    r1579 r2226  
    77        function build(pObj) 
    88        { 
    9                 var _window = document.getElementById( pObj.id_window + '__parent'); 
     9                var _window = getElement( pObj.id_window + '__parent'); 
    1010                Xtools = new JITXtools(path);            
    1111                 
     
    1414                        pObj.width              = ( ( pObj.width > 160 ) ? pObj.width : 160 ); 
    1515                        pObj.height             = ( ( pObj.height > 80 ) ? pObj.height : 80 ); 
    16                         pObj.onclick    = "winBuild ('" + pObj.id_window + "', '" + pObj.closeAction + "')"; 
     16                        pObj.onclick    = "winBuild('" + pObj.id_window + "', '" + pObj.closeAction + "')"; 
    1717                         
    1818                        _window = document.createElement("div"); 
     
    2727                        _window.innerHTML               = Xtools.parse( Xtools.xml('window_main'), 'window.xsl', pObj ); 
    2828 
     29                        if( pObj.closeAction == "hidden" ) 
     30                                _window.setAttribute("leftOld", pObj.left + "px" ); 
     31                         
    2932                        window.document.body.insertBefore( _window, document.body.lastChild ); 
     33                         
     34                        getElement(pObj.id_window + '__content').innerHTML = pObj.content;  
    3035                         
    3136                        if( pObj.draggable ) 
     
    3641                } 
    3742                else 
    38                         _load(pObj.id_window, "display"); 
     43                { 
     44                        load(pObj.id_window, "display"); 
     45                } 
    3946        } 
    4047 
    41         function _content( pId, pContent ) 
     48        function getElement(pElement) 
    4249        { 
    43                 var _contentWindow = function() 
    44                 { 
    45                         var _win_content = document.getElementById(pId + "__content"); 
    46                         _win_content.innerHTML = pContent; 
    47                 }; 
    48  
    49                 setTimeout( _contentWindow, 220 ); 
     50                return document.getElementById(pElement); 
    5051        } 
    5152         
    52         function Load( pId, pVisible ) 
     53        function load( pId, pVisible ) 
    5354        { 
    54                 var winM = document.getElementById( pId + '__parent'); 
     55                var winM = document.getElementById( pId + '__parent') 
    5556                 
    5657                if( winM != null ) 
    5758                { 
    5859                        if ( pVisible == "display" ) 
    59                                 winM.style.left = "70px"; 
     60                        { 
     61                                if(winM.getAttribute("leftOld") != "-1500px") 
     62                                        winM.style.left = winM.getAttribute("leftOld"); 
     63                                else 
     64                                        winM.style.left = "70px"; 
     65                        }        
    6066                         
    6167                        if ( pVisible == "hidden") 
     68                        { 
     69                                winM.setAttribute("leftOld" , winM.style.left ); 
    6270                                winM.style.left = "-1500px"; 
     71                        } 
    6372                         
    6473                        if( pVisible == "remove" ) 
     74                        { 
    6575                                document.body.removeChild( winM ); 
     76                        } 
    6677                } 
    6778        } 
     
    6980        function _window() 
    7081        { 
    71                 var objectW = null; 
    72                  
    73                 if( arguments.length == 1 ) 
     82                if( arguments.length > 0 ) 
    7483                { 
    75                         objectW = arguments[0]; 
     84                        if( arguments.length == 1 ) 
     85                        { 
     86                                JSLoader.load([path + "js/dragdrop.js"]); 
     87                                JSLoader.load([path + "templates/default/css/button.css"]) 
    7688 
    77                         JSLoader.load([path + "js/dragdrop.js"]); 
    78                         JSLoader.load([path + "templates/default/css/button.css"]) 
     89                                var obj = arguments[0]; 
     90         
     91                                setTimeout(function(){ build(obj);}, 200); 
     92                        } 
    7993 
    80                         setTimeout( function(){ build(objectW); }, 200 ); 
    81                 } 
    82                  
    83                 if( arguments.length == 2 ) 
    84                         Load(arguments[0], arguments[1]); 
    85                  
    86                 if( arguments.length === 3 ) 
    87                         _content( arguments[0], arguments[1]); 
     94                        if( arguments.length == 2 ) 
     95                        { 
     96                                load(arguments[0], arguments[1]); 
     97                        }        
     98                }        
    8899        } 
    89100 
     
    94105function winBuild() 
    95106{ 
    96         if( arguments.length == 1 ) 
    97                 _win = new bWindow( arguments[0] ); 
    98          
    99         if( arguments.length == 2 ) 
    100                 _win = new bWindow( arguments[0], arguments[1] ); 
    101          
    102         if( arguments.length == 3 ) 
    103                 _win = new bWindow( arguments[0], arguments[1], arguments[2] ); 
     107        if( arguments.length > 0 ) 
     108        {        
     109                if( arguments.length == 1 ) 
     110                        _win = new bWindow( arguments[0] ); 
     111                 
     112                if( arguments.length == 2 ) 
     113                        _win = new bWindow( arguments[0], arguments[1] ); 
     114        } 
    104115} 
Note: See TracChangeset for help on using the changeset viewer.