From c7de0310a4d92eaf512fdac73472b8b584734e2c Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 24 Nov 2011 10:26:35 +0000 Subject: - Mark (with different color) folders with recent messages (#1486234) git-svn-id: https://svn.roundcube.net/trunk@5483 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/app.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'roundcubemail/program/js') diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index cc1eeef15..d71415618 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -2021,6 +2021,7 @@ function rcube_webmail() 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 @@ function rcube_webmail() } }; + // 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 @@ function rcube_webmail() }; // 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 -- cgit v1.2.3