v1.18.x
psychobunny 10 years ago
parent fc19405170
commit d51407834d

@ -36,7 +36,7 @@ define('forum/topic', [
app.enterRoom('topic_' + tid); app.enterRoom('topic_' + tid);
posts.processPage($('.topic')); posts.processPage(components.get('post'));
postTools.init(tid); postTools.init(tid);
threadTools.init(tid); threadTools.init(tid);

@ -247,21 +247,21 @@ define('forum/topic/posts', [
}); });
} }
Posts.processPage = function(element) { Posts.processPage = function(posts) {
app.createUserTooltips(); app.createUserTooltips();
app.replaceSelfLinks(element.find('a')); app.replaceSelfLinks(posts.find('a'));
utils.addCommasToNumbers(element.find('.formatted-number')); utils.addCommasToNumbers(posts.find('.formatted-number'));
utils.makeNumbersHumanReadable(element.find('.human-readable-number')); utils.makeNumbersHumanReadable(posts.find('.human-readable-number'));
element.find('.timeago').timeago(); posts.find('.timeago').timeago();
element.find('[component="post/content"] img:not(.emoji)').each(function() { posts.find('[component="post/content"] img:not(.emoji)').each(function() {
var $this = $(this); var $this = $(this);
if (!$this.parent().is('a')) { if (!$this.parent().is('a')) {
$this.wrap('<a href="' + $this.attr('src') + '" target="_blank">'); $this.wrap('<a href="' + $this.attr('src') + '" target="_blank">');
} }
}); });
postTools.updatePostCount(); postTools.updatePostCount();
addBlockquoteEllipses(element.find('[component="post/content"] > blockquote')); addBlockquoteEllipses(posts.find('[component="post/content"] > blockquote'));
hidePostToolsForDeletedPosts(element); hidePostToolsForDeletedPosts(posts);
showBottomPostBar(); showBottomPostBar();
}; };
@ -271,9 +271,11 @@ define('forum/topic/posts', [
} }
} }
function hidePostToolsForDeletedPosts(element) { function hidePostToolsForDeletedPosts(posts) {
element.find('[data-pid].deleted').each(function() { posts.each(function() {
postTools.toggle($(this).attr('data-pid'), true); if ($(this).hasClass('deleted')) {
postTools.toggle($(this).attr('data-pid'), true);
}
}); });
} }

Loading…
Cancel
Save