From 8f7c22d32cf40a6d8b07609ce74a61e2a8ad4de2 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 24 Mar 2015 20:44:46 -0700 Subject: [PATCH] Consolidate Unread Favicon code a bit. --- src/Monitoring/Unread.coffee | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 71a4a4345..74e485977 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -228,26 +228,15 @@ Unread = unread: count quotingYou: countQuotingYou - return unless Conf['Unread Favicon'] - - Favicon.el.href = - if Unread.thread.isDead + if Conf['Unread Favicon'] + {isDead} = Unread.thread + Favicon.el.href = if countQuotingYou - Favicon.unreadDeadY + Favicon[if isDead then 'unreadDeadY' else 'unreadY'] else if count - Favicon.unreadDead + Favicon[if isDead then 'unreadDead' else 'unread'] else - Favicon.dead - else - if count - if countQuotingYou - Favicon.unreadY - else - Favicon.unread - else - Favicon.default - - <% if (type === 'userscript') { %> - # `favicon.href = href` doesn't work on Firefox. - $.add d.head, Favicon.el - <% } %> + Favicon[if isDead then 'dead' else 'default'] + unless chrome? + # `favicon.href = href` doesn't work on Firefox. + $.add d.head, Favicon.el