Changeset 5343 in subversion


Ignore:
Timestamp:
Oct 18, 2011 9:45:38 AM (20 months ago)
Author:
alec
Message:
  • Code and small perf. improvements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r5342 r5343  
    16791679    }); 
    16801680 
    1681     var c, html, tree = expando = '', 
     1681    var c, n, col, html, tree = '', expando = '', 
    16821682      list = this.message_list, 
    16831683      rows = list.rows, 
    1684       tbody = this.gui_objects.messagelist.tBodies[0], 
    1685       rowcount = tbody.rows.length, 
    1686       even = rowcount%2, 
    16871684      message = this.env.messages[uid], 
    16881685      css_class = 'message' 
     
    16931690        + (message.selected ? ' selected' : ''), 
    16941691      // for performance use DOM instead of jQuery here 
    1695       row = document.createElement('tr'), 
    1696       col = document.createElement('td'); 
     1692      row = document.createElement('tr'); 
    16971693 
    16981694    row.id = 'rcmrow'+uid; 
     
    17211717    // threads 
    17221718    if (this.env.threading) { 
    1723       // This assumes that div width is hardcoded to 15px, 
    1724       var width = message.depth * 15; 
    17251719      if (message.depth) { 
     1720        // This assumes that div width is hardcoded to 15px, 
     1721        tree += '<span id="rcmtab' + uid + '" class="branch" style="width:' + (message.depth * 15) + 'px;">&nbsp;&nbsp;</span>'; 
     1722 
    17261723        if ((rows[message.parent_uid] && rows[message.parent_uid].expanded === false) 
    17271724          || ((this.env.autoexpand_threads == 0 || this.env.autoexpand_threads == 2) && 
     
    17381735          message.expanded = true; 
    17391736        } 
    1740       } 
    1741  
    1742       if (width) 
    1743         tree += '<span id="rcmtab' + uid + '" class="branch" style="width:' + width + 'px;">&nbsp;&nbsp;</span>'; 
    1744  
    1745       if (message.has_children && !message.depth) 
     1737 
    17461738        expando = '<div id="rcmexpando' + uid + '" class="' + (message.expanded ? 'expanded' : 'collapsed') + '">&nbsp;&nbsp;</div>'; 
     1739      } 
    17471740    } 
    17481741 
     
    17581751 
    17591752    // add each submitted col 
    1760     for (var n in this.env.coltypes) { 
     1753    for (n in this.env.coltypes) { 
    17611754      c = this.env.coltypes[n]; 
    17621755      col = document.createElement('td'); 
     
    41164109  this.add_contact_row = function(cid, cols, select) 
    41174110  { 
    4118     if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0]) 
     4111    if (!this.gui_objects.contactslist) 
    41194112      return false; 
    41204113 
    4121     var c, tbody = this.gui_objects.contactslist.tBodies[0], 
     4114    var c, list = this.contact_list, 
    41224115      row = document.createElement('tr'); 
    41234116 
     
    41254118    row.className = 'contact'; 
    41264119 
    4127     if (this.contact_list.in_selection(cid)) 
     4120    if (list.in_selection(cid)) 
    41284121      row.className += ' selected'; 
    41294122 
     
    41364129    } 
    41374130 
    4138     this.contact_list.insert_row(row); 
    4139  
    4140     this.enable_command('export', (this.contact_list.rowcount > 0)); 
     4131    list.insert_row(row); 
     4132 
     4133    this.enable_command('export', list.rowcount > 0); 
    41414134  }; 
    41424135 
Note: See TracChangeset for help on using the changeset viewer.