From fc3a916e86e1697c5df0fac3a83bdee873f47da9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 7 Apr 2011 15:57:03 +0200 Subject: [PATCH] Reset activation after all notifications have been removed. --- src/main/resources/static/javascript/sone.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 596c19c..0d413b9 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1001,6 +1001,10 @@ function getStatus() { } $(this).slideUp("normal", function() { $(this).remove(); + /* remove activity when no notifications are visible. */ + if ($("#sone #notification-area .notification").length == 0) { + resetActivity(); + } }); } }); @@ -1032,10 +1036,6 @@ function getStatus() { $.each(data.newReplies, function(index, value) { loadNewReply(value.id, value.sone, value.post, value.postSone); }); - /* remove activity when no notifications are visible. */ - if ($("#sone #notification-area .notification").length == 0) { - resetActivity(); - } /* do it again in 5 seconds. */ setTimeout(getStatus, 5000); } else { @@ -1367,6 +1367,7 @@ function resetActivity() { if (title.indexOf('(') == 0) { setTitle(title.substr(title.indexOf(' ') + 1)); } + iconBlinking = false; } function setActivity() { @@ -1405,7 +1406,7 @@ var iconBlinking = false; * showing the activity state, it is returned to normal. */ function toggleIcon() { - if (focus) { + if (focus || !iconBlinking) { if (iconActive) { changeIcon("images/icon.png"); iconActive = false; -- 2.7.4