[Svn] r3364 - in branches/devel-threads/program: js steps/mail

trac at roundcube.net trac at roundcube.net
Wed Mar 17 11:40:55 CET 2010


Author: thomasb
Date: 2010-03-17 05:40:55 -0500 (Wed, 17 Mar 2010)
New Revision: 3364

Modified:
   branches/devel-threads/program/js/app.js
   branches/devel-threads/program/steps/mail/func.inc
Log:
Fix thead replacement in IE (unknown errors)

Modified: branches/devel-threads/program/js/app.js
===================================================================
--- branches/devel-threads/program/js/app.js	2010-03-15 20:32:08 UTC (rev 3363)
+++ branches/devel-threads/program/js/app.js	2010-03-17 10:40:55 UTC (rev 3364)
@@ -4194,16 +4194,23 @@
     this.env.coltypes = coltypes;
     
     // set correct list titles
-    var cell, col, found, n;
     var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null;
 
     // replace old column headers
     if (thead && repl) {
-      // throws an 'unknown runtime error' on IE (WTF?)
-      try { this.gui_objects.messagelist.tHead.innerHTML = repl; }
-      catch(e) { }
+      for (var cell, c=0; c < repl.length; c++) {
+        cell = thead.rows[0].cells[c];
+        if (!cell) {
+          cell = document.createElement('td');
+          thead.rows[0].appendChild(cell);
+        }
+        cell.innerHTML = repl[c].html;
+        if (repl[c].id) cell.id = repl[c].id;
+        if (repl[c].className) cell.className = repl[c].className;
+      }
     }
 
+    var cell, col, n;
     for (n=0; thead && n<this.env.coltypes.length; n++)
       {
       col = this.env.coltypes[n];
@@ -4230,6 +4237,7 @@
     this.env.subject_col = null;
     this.env.flagged_col = null;
 
+    var found;
     if((found = find_in_array('subject', this.env.coltypes)) >= 0) {
       this.set_env('subject_col', found);
       if (this.message_list)

Modified: branches/devel-threads/program/steps/mail/func.inc
===================================================================
--- branches/devel-threads/program/steps/mail/func.inc	2010-03-15 20:32:08 UTC (rev 3363)
+++ branches/devel-threads/program/steps/mail/func.inc	2010-03-17 10:40:55 UTC (rev 3364)
@@ -202,9 +202,13 @@
   
   $OUTPUT->include_script('list.js');
   
+  $thead = '';
+  foreach (rcmail_message_list_head($attrib, $a_show_cols) as $cell)
+    $thead .= html::tag('td', array('class' => $cell['className'], 'id' => $cell['id']), $cell['html']);
+  
   return html::tag('table',
     $attrib,
-    html::tag('thead', null, rcmail_message_list_head($attrib, $a_show_cols)) .
+    html::tag('thead', null, html::tag('tr', null, $thead)) .
       html::tag('tbody', null, ''),
     array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
 }
@@ -343,7 +347,7 @@
   else
     $list_menu = '';
 
-  $out = html::tag('td', array('class' => 'threads'), $list_menu);
+  $cells = array(array('className' => 'threads', 'html' => $list_menu));
 
   foreach ($a_show_cols as $col) {
     // get column name
@@ -366,10 +370,10 @@
     $class_name = $col == 'attachment' ? 'icon' : $col.$sort_class;
 
     // put it all together
-    $out .= html::tag('td', array('class' => $class_name, 'id' => "rcm$col"), $col_name);
+    $cells[] = array('className' => $class_name, 'id' => "rcm$col", 'html' => $col_name);
   }
 
-  return html::tag('tr', null, $out);
+  return $cells;
 }
 
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list