Don't call Unread.update all the time.

This commit is contained in:
Nicolas Stepien 2013-03-31 01:26:02 +01:00
parent 7126768855
commit f308eed714

View File

@ -3718,7 +3718,7 @@ Unread =
else if Unread.hr.parentNode else if Unread.hr.parentNode
$.rm Unread.hr $.rm Unread.hr
update: -> update: <% if (type === 'crx') { %>(dontrepeat) <% } %>->
count = Unread.posts.length count = Unread.posts.length
if Conf['Unread Count'] if Conf['Unread Count']
@ -3729,10 +3729,12 @@ Unread =
<% if (type === 'crx') { %> <% if (type === 'crx') { %>
# XXX Chrome bug where it doesn't always update the tab title. # XXX Chrome bug where it doesn't always update the tab title.
# crbug.com/124381 # crbug.com/124381
title = d.title # Call it one second later,
# but don't display outdated unread count.
unless dontrepeat
setTimeout -> setTimeout ->
d.title = '' d.title = ''
Unread.update() Unread.update true
, $.SECOND , $.SECOND
<% } %> <% } %>