mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #3166
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user