mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: allow adding nested replies to a target component
This commit is contained in:
@@ -34,8 +34,14 @@ define('forum/topic/replies', ['navigator', 'components', 'forum/topic/posts'],
|
|||||||
hideReplies: config.hasOwnProperty('showNestedReplies') ? !config.showNestedReplies : true,
|
hideReplies: config.hasOwnProperty('showNestedReplies') ? !config.showNestedReplies : true,
|
||||||
};
|
};
|
||||||
app.parseAndTranslate('topic', 'posts', tplData, function (html) {
|
app.parseAndTranslate('topic', 'posts', tplData, function (html) {
|
||||||
$('<div>', { component: 'post/replies' }).html(html).hide().insertAfter(button)
|
var repliesEl = $('<div>', { component: 'post/replies' }).html(html).hide();
|
||||||
.slideDown('fast');
|
if (button.attr('data-target-component')) {
|
||||||
|
post.find('[component="' + button.attr('data-target-component') + '"]').html(repliesEl);
|
||||||
|
} else {
|
||||||
|
repliesEl.insertAfter(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
repliesEl.slideDown('fast');
|
||||||
posts.onNewPostsAddedToDom(html);
|
posts.onNewPostsAddedToDom(html);
|
||||||
$(window).trigger('action:posts.loaded', { posts: data });
|
$(window).trigger('action:posts.loaded', { posts: data });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user