diff options
author | Zach Copley <zach@status.net> | 2009-11-17 00:31:19 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-11-17 00:31:19 +0000 |
commit | aee6e2d91c9efa8709b20d74504be10338cd671e (patch) | |
tree | 63fae4ea46dfe5d852b1dbe69e57f0a807b8d0e5 /plugins | |
parent | fb646654a25dd13b38cd177f3236d8e9f2d9bbb9 (diff) | |
parent | a6399ce73a7459a8ee7bc18f6b8c449e0b45b5fb (diff) |
Merge branch '0.8.x'
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 2ded33e93..fa0fefed4 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -36,6 +36,7 @@ RealtimeUpdate = { _updatecounter: 0, _updatedelay: 500, _maxnotices: 50, + _windowhasfocus: false, init: function(userid, replyurl, favorurl, deleteurl) { @@ -46,7 +47,9 @@ RealtimeUpdate = { DT = document.title; - $(window).blur(function() { + $(window).bind('focus', function(){ RealtimeUpdate._windowhasfocus = true; }); + + $(window).bind('blur', function() { $('#notices_primary .notice').css({ 'border-top-color':$('#notices_primary .notice:last').css('border-top-color'), 'border-top-style':'dotted' @@ -59,6 +62,7 @@ RealtimeUpdate = { RealtimeUpdate._updatecounter = 0; document.title = DT; + RealtimeUpdate._windowhasfocus = false; return false; }); @@ -82,15 +86,17 @@ RealtimeUpdate = { if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { $("#notices_primary .notice:last .form_disfavor").unbind('submit'); $("#notices_primary .notice:last .form_favor").unbind('submit'); - $("#notices_primary .notice:last #notice_in-reply-to").unbind('click'); + $("#notices_primary .notice:last .notice_reply").unbind('click'); $("#notices_primary .notice:last").remove(); } NoticeFavors(); NoticeReply(); - RealtimeUpdate._updatecounter += 1; - document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + if (RealtimeUpdate._windowhasfocus === false) { + RealtimeUpdate._updatecounter += 1; + document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + } }, RealtimeUpdate._updatedelay); }, |