From 4438d667609406abd969872f262d6a11b0e28b72 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 17 Oct 2010 17:43:05 +0000 Subject: - Add separate column for message status icon (#1486665) --- program/js/app.js | 58 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 24 deletions(-) (limited to 'program/js') diff --git a/program/js/app.js b/program/js/app.js index cb94d9597..558a8b8a7 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1550,8 +1550,10 @@ function rcube_webmail() if (uid && this.env.messages[uid]) $.extend(row, this.env.messages[uid]); - // set eventhandler to message icon - if (this.env.subject_col != null && (row.icon = document.getElementById('msgicn'+row.uid))) { + row.msgicon = document.getElementById('msgicn'+row.uid); + + // set eventhandler to message status icon + if (row.icon = document.getElementById('statusicn'+row.uid)) { row.icon._row = row.obj; row.icon.onmousedown = function(e) { self.command('toggle_status', this); rcube_event.cancel(e); }; } @@ -1618,20 +1620,14 @@ function rcube_webmail() row.id = 'rcmrow'+uid; row.className = css_class; - // message status icon + // message status icons css_class = 'msgicon'; if (!flags.unread && flags.unread_children > 0) css_class += ' unreadchildren'; - if (flags.deleted) - css_class += ' deleted'; - else if (flags.replied || flags.forwarded) { - if (flags.replied) - css_class += ' replied'; - if (flags.forwarded) - css_class += ' forwarded'; - } - else if (flags.unread) - css_class += ' unread'; + if (flags.replied) + css_class += ' replied'; + if (flags.forwarded) + css_class += ' forwarded'; // update selection if (message.selected && !list.in_selection(uid)) @@ -1693,6 +1689,15 @@ function rcube_webmail() else html = ' '; } + else if (c == 'status') { + if (flags.deleted) + css_class = 'deleted'; + else if (flags.unread) + css_class = 'unread'; + else + css_class = 'msgicon'; + html = ' '; + } else if (c == 'threads') html = expando; else if (c == 'subject') @@ -2221,23 +2226,28 @@ function rcube_webmail() return false; if (rows[uid].icon) { - css_class = 'msgicon'; - if (!rows[uid].unread && rows[uid].unread_children) - css_class += ' unreadchildren'; if (rows[uid].deleted) - css_class += ' deleted'; - else if (rows[uid].replied || rows[uid].forwarded) { - if (rows[uid].replied) - css_class += ' replied'; - if (rows[uid].forwarded) - css_class += ' forwarded'; - } + css_class = 'deleted'; else if (rows[uid].unread) - css_class += ' unread'; + css_class = 'unread'; + else + css_class = 'msgicon'; rows[uid].icon.className = css_class; } + if (rows[uid].msgicon) { + css_class = 'msgicon'; + if (!rows[uid].unread && rows[uid].unread_children) + css_class += ' unreadchildren'; + if (rows[uid].replied) + css_class += ' replied'; + if (rows[uid].forwarded) + css_class += ' forwarded'; + + rows[uid].msgicon.className = css_class; + } + if (rows[uid].flagged_icon) { css_class = (rows[uid].flagged ? 'flagged' : 'unflagged'); rows[uid].flagged_icon.className = css_class; -- cgit v1.2.3