Changeset 2602


Ignore:
Timestamp:
04/20/10 11:55:50 (14 years ago)
Author:
amuller
Message:

Ticket #1036 - Arrumando código com metodos dom ao inves do innerHTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/jscode/DropDownContacts.js

    r2579 r2602  
    7474        } 
    7575 
    76         var table_contacts_header = "<table style='font-family:arial;font-size:12;color:#0000CF' border=0 cellpadding=0 cellspacing=0>"; 
    77         var table_contacts_foot = "</table>"; 
    78         var lines = ''; 
     76        var lines = document.createElement('TABLE'); 
     77        lines.style.fontFamily='Arial'; 
     78        lines.style.font='12pt'; 
     79        lines.style.color='#0000CF'; 
     80        lines.border='0'; 
     81        lines.cellpadding='0'; 
     82        lines.cellspacing='0'; 
     83 
    7984        var REG_EXP = /^[^\#|^\$|^\%|^\!|^\?|^\"|^\']+$/; 
    8085        var match_cont = ""; 
     
    9095                        } 
    9196                } 
    92                 //lines = lines + "<tr><td id=td_DD_"+i+" onClick=\"javascript:hideTip();makeMailList('"+match_contacts[i]+"','"+fld_id+"');document.getElementById('" + fld_id + "').focus();\" onmouseover=\"selectContact("+i+")\">" + match_contacts[i] + "</td></tr>" 
    93                 lines = lines + "<tr><td id=td_DD_"+i+" onMouseDown=\"javascript:hideTip();makeMailList('"+match_cont+"','"+fld_id+"');setTimeout('document.getElementById(\\'"+fld_id+"\\').focus()',300);\" onmouseover=\"selectContact("+i+")\">" + match_cont + "</td></tr>"; 
     97                var trElement = document.createElement('TR'); 
     98                var tdElement = document.createElement('TD'); 
     99                tdElement.id = 'td_DD_'+i; 
     100                tdElement.name = fld_id; 
     101                tdElement.onmousedown = function (){ 
     102                        hideTip(); 
     103                        makeMailList(this.innerHTML,this.name); 
     104                        setTimeout('document.getElementById("'+this.name+'").focus()',300); 
     105                }; 
     106                tdElement.onmouseover = function (){ 
     107                        selectContact(this.id.substr(6)); 
     108                }; 
     109                tdElement.innerHTML = match_cont; 
     110                trElement.appendChild(tdElement); 
     111                lines.appendChild(trElement); 
    94112                match_cont = ""; 
    95113        } 
     
    126144                } 
    127145        } 
    128  
    129         if (lines != ''){ 
    130                 table_contacts = table_contacts_header + lines + table_contacts_foot; 
    131                 doTooltip(posX, posY, table_contacts); 
     146        if (lines.childNodes.length > 0){ 
     147                doTooltip(posX, posY, lines); 
    132148        } 
    133149        else 
     
    262278     
    263279    writeTip: function(msg) { 
    264         if ( this.tip && typeof this.tip.innerHTML != "undefined" ) this.tip.innerHTML = msg; 
     280        if ( typeof this.tip != "undefined" ) { 
     281                this.tip.innerHTML = ""; 
     282                this.tip.appendChild(msg); 
     283        } 
    265284        this.tip.style.width = 'auto'; 
    266285    }, 
     
    282301                this.handleOverlay(0, this.hideDelay); 
    283302        this.timer = setTimeout("Tooltip.toggleVis('" + this.tipID + "', 'hidden')", this.hideDelay); 
    284         this.tip = null;  
     303        this.tip = null;   
    285304    }, 
    286305     
Note: See TracChangeset for help on using the changeset viewer.