From d51407834dfb6bc5993c429ef7528b0965dc6381 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Fri, 29 May 2015 16:19:04 -0400 Subject: [PATCH] closes #3166 --- public/src/client/topic.js | 2 +- public/src/client/topic/posts.js | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 95b84204fe..e5f01706bc 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -36,7 +36,7 @@ define('forum/topic', [ app.enterRoom('topic_' + tid); - posts.processPage($('.topic')); + posts.processPage(components.get('post')); postTools.init(tid); threadTools.init(tid); diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 2104bc04fa..3548e1bdf1 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -247,21 +247,21 @@ define('forum/topic/posts', [ }); } - Posts.processPage = function(element) { + Posts.processPage = function(posts) { app.createUserTooltips(); - app.replaceSelfLinks(element.find('a')); - utils.addCommasToNumbers(element.find('.formatted-number')); - utils.makeNumbersHumanReadable(element.find('.human-readable-number')); - element.find('.timeago').timeago(); - element.find('[component="post/content"] img:not(.emoji)').each(function() { + app.replaceSelfLinks(posts.find('a')); + utils.addCommasToNumbers(posts.find('.formatted-number')); + utils.makeNumbersHumanReadable(posts.find('.human-readable-number')); + posts.find('.timeago').timeago(); + posts.find('[component="post/content"] img:not(.emoji)').each(function() { var $this = $(this); if (!$this.parent().is('a')) { $this.wrap(''); } }); postTools.updatePostCount(); - addBlockquoteEllipses(element.find('[component="post/content"] > blockquote')); - hidePostToolsForDeletedPosts(element); + addBlockquoteEllipses(posts.find('[component="post/content"] > blockquote')); + hidePostToolsForDeletedPosts(posts); showBottomPostBar(); }; @@ -271,9 +271,11 @@ define('forum/topic/posts', [ } } - function hidePostToolsForDeletedPosts(element) { - element.find('[data-pid].deleted').each(function() { - postTools.toggle($(this).attr('data-pid'), true); + function hidePostToolsForDeletedPosts(posts) { + posts.each(function() { + if ($(this).hasClass('deleted')) { + postTools.toggle($(this).attr('data-pid'), true); + } }); }