From 101fe81d42a90b83ce3c461e5287574f136e6f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 3 May 2023 21:19:02 -0400 Subject: [PATCH] feat: add app.newReply like app.newTopic --- public/src/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/src/app.js b/public/src/app.js index 295555f19f..a4e25beab2 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -289,6 +289,17 @@ if (document.readyState === 'loading') { }); }; + app.newReply = async function (tid) { + const [hooks, api] = await app.require(['hooks', 'api']); + const titleRaw = ajaxify.data.template.topic ? + ajaxify.data.titleRaw : + (await api.get(`/topics/${tid}`)).titleRaw; + hooks.fire('action:composer.post.new', { + tid: tid, + topicName: titleRaw, + }); + }; + app.loadJQueryUI = function (callback) { if (typeof $().autocomplete === 'function') { return callback();