Don't reset the inactive counter when we focus OUT of a tab. derp

This commit is contained in:
Nicolas Stepien 2012-07-11 15:53:51 +02:00
parent 7646eaa186
commit 05cb2fcd3c
2 changed files with 8 additions and 0 deletions

View File

@ -2877,6 +2877,12 @@
}
$.add(d.body, dialog);
return $.on(d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', function() {
var state;
state = d.visibilityState || d.oVisibilityState || d.mozVisibilityState || d.webkitVisibilityState;
if (state !== 'visible') {
return;
}
$.log(state);
Updater.unsuccessfulFetchCount = 0;
if (Updater.timer.textContent < -Conf['Interval']) {
return Updater.timer.textContent = -Updater.getInterval();

View File

@ -2306,6 +2306,8 @@ Updater =
$.add d.body, dialog
$.on d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', ->
state = d.visibilityState or d.oVisibilityState or d.mozVisibilityState or d.webkitVisibilityState
return if state isnt 'visible'
# Reset the counter when we focus this tab.
Updater.unsuccessfulFetchCount = 0
if Updater.timer.textContent < -Conf['Interval']