# HG changeset patch # User neko259 # Date 2015-04-22 15:01:34 # Node ID b9ff48e53cbdef2808d79bb5c95bec488e36478e # Parent ef65332bc3b303dd2b88b5d0c763cbc0fb645a30 Show new posts count title only if there are new posts. But show an asterisk in title if any posts are updated (even with 0 new ones) diff --git a/boards/static/js/thread_update.js b/boards/static/js/thread_update.js --- a/boards/static/js/thread_update.js +++ b/boards/static/js/thread_update.js @@ -121,8 +121,13 @@ function getThreadDiff() { updateMetadataPanel(); } - updateBumplimitProgress(addedPostCount); - showNewPostsTitle(addedPostCount); + if (addedPostCount > 0) { + updateBumplimitProgress(addedPostCount); + } + + if (updatedPosts.length > 0) { + showNewPostsTitle(addedPostCount); + } // TODO Process removed posts if any $('.metapanel').attr('data-last-update', data.last_update); @@ -254,7 +259,14 @@ function showNewPostsTitle(newPostCount) documentOriginalTitle = document.title; } unreadPosts = unreadPosts + newPostCount; - document.title = '[' + unreadPosts + '] ' + documentOriginalTitle; + + var newTitle = '* '; + if (unreadPosts > 0) { + newTitle += '[' + unreadPosts + '] '; + } + newTitle += documentOriginalTitle; + + document.title = newTitle; document.addEventListener('visibilitychange', function() { if (documentOriginalTitle !== '') {