Skip to content

Node.js based forum software built for the modern web

closes #3166

psychobunnyd51407834dfb
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('<a href="' + $this.attr('src') + '" target="_blank">');
}
});
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);
+ }
});
}