From 636bd77074638a1132b8933c4fb114373aaec296 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 24 Nov 2011 05:26:35 -0500
Subject: [PATCH] - Mark (with different color) folders with recent messages (#1486234)

---
 program/js/app.js |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index cc1eeef..d714156 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2021,6 +2021,7 @@
       url += '&_refresh=1';
 
     this.select_folder(mbox, '', true);
+    this.unmark_folder(mbox, 'recent', '', true);
     this.env.mailbox = mbox;
 
     // load message list remotely
@@ -5448,6 +5449,18 @@
     }
   };
 
+  // adds a class to selected folder
+  this.mark_folder = function(name, class_name, prefix, encode)
+  {
+    $(this.get_folder_li(name, prefix, encode)).addClass(class_name);
+  };
+
+  // adds a class to selected folder
+  this.unmark_folder = function(name, class_name, prefix, encode)
+  {
+    $(this.get_folder_li(name, prefix, encode)).removeClass(class_name);
+  };
+
   // helper method to find a folder list item
   this.get_folder_li = function(name, prefix, encode)
   {
@@ -5555,13 +5568,16 @@
   };
 
   // update the mailboxlist
-  this.set_unread_count = function(mbox, count, set_title)
+  this.set_unread_count = function(mbox, count, set_title, mark)
   {
     if (!this.gui_objects.mailboxlist)
       return false;
 
     this.env.unread_counts[mbox] = count;
     this.set_unread_count_display(mbox, set_title);
+
+    if (mark)
+      this.mark_folder(mbox, mark, '', true);
   };
 
   // update the mailbox count display

--
Gitblit v1.9.1