Consolidate Unread Favicon code a bit.

This commit is contained in:
ccd0 2015-03-24 20:44:46 -07:00
parent e98c2d1cc6
commit 8f7c22d32c

View File

@ -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