X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=d60ee230157664d7d2b1711e233983362c518985;hb=e17523ae9c800ddf6a8e31bfa4a56f4aa0278aec;hp=596c19ca15c3c500ce0eb8ae62d2dc924858cc85;hpb=5777cb6291375cdd4cbc2c781d1fea807da566f8;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 596c19c..d60ee23 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 { @@ -1335,9 +1335,6 @@ function updatePostTimes(postIds) { * The tooltip to show */ function updateReplyTime(replyId, timeText, refreshTime, tooltip) { - if (!getReply(replyId).is(":visible")) { - return; - } getReply(replyId).find(".reply-status-line > .time").html(timeText).attr("title", tooltip); (function(replyId, refreshTime) { setTimeout(function() { @@ -1367,6 +1364,7 @@ function resetActivity() { if (title.indexOf('(') == 0) { setTitle(title.substr(title.indexOf(' ') + 1)); } + iconBlinking = false; } function setActivity() { @@ -1405,7 +1403,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;