fix: convert some hooks to use hooks module

re: julianlam/nodebb-plugin-markdown#130
This commit is contained in:
Julian Lam
2021-06-25 16:52:46 -04:00
parent a76eab1ca2
commit 09bac6bd7e
5 changed files with 16 additions and 10 deletions

View File

@@ -9,7 +9,8 @@ define('forum/topic/posts', [
'navigator',
'components',
'translator',
], function (pagination, infinitescroll, postTools, images, navigator, components, translator) {
'hooks',
], function (pagination, infinitescroll, postTools, images, navigator, components, translator, hooks) {
var Posts = { };
Posts.onNewPost = function (data) {
@@ -226,7 +227,7 @@ define('forum/topic/posts', [
infinitescroll.removeExtra($('[component="post"]'), direction, Math.max(20, config.postsPerPage * 2));
$(window).trigger('action:posts.loaded', { posts: data.posts });
hooks.fire('action:posts.loaded', { posts: data.posts });
Posts.onNewPostsAddedToDom(html);