From f1078035501863b134a032e1377108fdf59b0567 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 21 Jan 2014 10:07:24 -0500 Subject: [PATCH] fix --- public/src/forum/footer.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index abee2958ac..9cf6d0c3a6 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -8,13 +8,6 @@ define(['notifications', 'chat'], function(Notifications, Chat) { Chat.prepareDOM(); translator.prepareDOM(); - function markCurrentTopicRead(tid) { - if(tids && tids.length > 0 && tids.indexOf(tid) !== -1) { - socket.emit('topics.markAsRead', {tid: tid, uid: app.uid}); - return; - } - } - function updateUnreadCount(err, tids) { var count = 0; if(tids && tids.length) { @@ -23,8 +16,11 @@ define(['notifications', 'chat'], function(Notifications, Chat) { var postContainer = $('#post-container'); if(postContainer.length) { - markCurrentTopicRead(postContainer.attr('data-tid')); - return; + var tid = postContainer.attr('data-tid'); + if(tids && tids.length > 0 && tids.indexOf(tid) !== -1) { + socket.emit('topics.markAsRead', {tid: tid, uid: app.uid}); + return; + } } $('#unread-count').toggleClass('unread-count', count > 0);