From 25d8ba63b3c4831050e5d190cd42cf2b0b0f3a30 Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Fri, 30 Jun 2006 18:02:28 -0400
Subject: [PATCH] Misc bug and compatibility fixes

---
 program/js/app.js |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index fb103bf..174920c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1452,6 +1452,7 @@
     
     for (var n in this.list_rows) {
       if (!filter || this.list_rows[n][filter]==true)
+        this.last_selected = n;
         this.highlight_row(n, true);
     }
     return true;  
@@ -3010,6 +3011,11 @@
     this.env.mailbox = mbox;
     };
 
+  // for reordering column array, Konqueror workaround
+  this.set_message_coltypes = function(coltypes) 
+  { 
+  this.coltypes = coltypes; 
+  }
 
   // create a table row in the message list
   this.add_message_row = function(uid, cols, flags, attachment, attop)
@@ -3042,8 +3048,9 @@
     row.appendChild(col);
 
     // add each submitted col
-    for (var c in cols)
-      {
+    for (var n = 0; n < this.coltypes.length; n++) 
+      { 
+      var c = this.coltypes[n];
       col = document.createElement('TD');
       col.className = String(c).toLowerCase();
       col.innerHTML = cols[c];
@@ -3087,7 +3094,10 @@
     {
     if (!this.gui_objects.mailboxlist)
       return false;
-      
+
+    if (mbox==this.env.mailbox)
+      set_title = true;
+
     var item, reg, text_obj;
     mbox = String(mbox).toLowerCase().replace(this.mbox_expression, '');
     item = document.getElementById('rcmbx'+mbox);
@@ -3104,14 +3114,14 @@
         text_obj.innerHTML += ' ('+count+')';
       else
         text_obj.innerHTML = text_obj.innerHTML.replace(reg, '');
-          
+
       // set the right classes
       this.set_classname(item, 'unread', count>0 ? true : false);
       }
 
     // set unread count to window title
     reg = /^\([0-9]+\)\s+/i;
-    if (set_title && count && document.title)	
+    if (set_title && document.title)
       {
       var doc_title = String(document.title);
 
@@ -3121,11 +3131,6 @@
         document.title = '('+count+') '+doc_title;
       else
         document.title = doc_title.replace(reg, '');
-      }
-    // remove unread count from window title
-    else if (document.title)
-      {
-      document.title = document.title.replace(reg, '');
       }
     };
 

--
Gitblit v1.9.1