From be70b3de57a10ff79dbfc6c9d00e2f377084aa44 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Mon, 3 Mar 2014 15:26:15 -0500 Subject: [PATCH] closes #1090 --- public/src/forum/unread.js | 11 ++++++++++- public/templates/unread.tpl | 2 +- src/socket.io/topics.js | 14 +++++++++++--- src/topics.js | 28 ++++++++++------------------ 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index 9829ca7a25..ac9b275a68 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -12,8 +12,17 @@ define(['forum/recent'], function(recent) { recent.watchForNewPosts(); $('#mark-allread-btn').on('click', function() { + function getUnreadTids() { + var tids = []; + $('#topics-container .category-item[data-tid]').each(function() { + tids.push($(this).attr('data-tid')); + }); + return tids; + } + var btn = $(this); - socket.emit('topics.markAllRead', function(err) { + + socket.emit('topics.markAllRead', getUnreadTids(), function(err) { if(err) { return app.alertError('There was an error marking topics read!'); } diff --git a/public/templates/unread.tpl b/public/templates/unread.tpl index c1aa0f87d1..58cd9eab1e 100644 --- a/public/templates/unread.tpl +++ b/public/templates/unread.tpl @@ -19,7 +19,7 @@