Changeset 3364 in subversion


Ignore:
Timestamp:
Mar 17, 2010 6:40:55 AM (3 years ago)
Author:
thomasb
Message:

Fix thead replacement in IE (unknown errors)

Location:
branches/devel-threads/program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-threads/program/js/app.js

    r3360 r3364  
    41954195     
    41964196    // set correct list titles 
    4197     var cell, col, found, n; 
    41984197    var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null; 
    41994198 
    42004199    // replace old column headers 
    42014200    if (thead && repl) { 
    4202       // throws an 'unknown runtime error' on IE (WTF?) 
    4203       try { this.gui_objects.messagelist.tHead.innerHTML = repl; } 
    4204       catch(e) { } 
    4205     } 
    4206  
     4201      for (var cell, c=0; c < repl.length; c++) { 
     4202        cell = thead.rows[0].cells[c]; 
     4203        if (!cell) { 
     4204          cell = document.createElement('td'); 
     4205          thead.rows[0].appendChild(cell); 
     4206        } 
     4207        cell.innerHTML = repl[c].html; 
     4208        if (repl[c].id) cell.id = repl[c].id; 
     4209        if (repl[c].className) cell.className = repl[c].className; 
     4210      } 
     4211    } 
     4212 
     4213    var cell, col, n; 
    42074214    for (n=0; thead && n<this.env.coltypes.length; n++) 
    42084215      { 
     
    42314238    this.env.flagged_col = null; 
    42324239 
     4240    var found; 
    42334241    if((found = find_in_array('subject', this.env.coltypes)) >= 0) { 
    42344242      this.set_env('subject_col', found); 
  • branches/devel-threads/program/steps/mail/func.inc

    r3348 r3364  
    203203  $OUTPUT->include_script('list.js'); 
    204204   
     205  $thead = ''; 
     206  foreach (rcmail_message_list_head($attrib, $a_show_cols) as $cell) 
     207    $thead .= html::tag('td', array('class' => $cell['className'], 'id' => $cell['id']), $cell['html']); 
     208   
    205209  return html::tag('table', 
    206210    $attrib, 
    207     html::tag('thead', null, rcmail_message_list_head($attrib, $a_show_cols)) . 
     211    html::tag('thead', null, html::tag('tr', null, $thead)) . 
    208212      html::tag('tbody', null, ''), 
    209213    array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); 
     
    344348    $list_menu = ''; 
    345349 
    346   $out = html::tag('td', array('class' => 'threads'), $list_menu); 
     350  $cells = array(array('className' => 'threads', 'html' => $list_menu)); 
    347351 
    348352  foreach ($a_show_cols as $col) { 
     
    367371 
    368372    // put it all together 
    369     $out .= html::tag('td', array('class' => $class_name, 'id' => "rcm$col"), $col_name); 
    370   } 
    371  
    372   return html::tag('tr', null, $out); 
     373    $cells[] = array('className' => $class_name, 'id' => "rcm$col", 'html' => $col_name); 
     374  } 
     375 
     376  return $cells; 
    373377} 
    374378 
Note: See TracChangeset for help on using the changeset viewer.