mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add app.newReply
like app.newTopic
This commit is contained in:
@@ -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) {
|
app.loadJQueryUI = function (callback) {
|
||||||
if (typeof $().autocomplete === 'function') {
|
if (typeof $().autocomplete === 'function') {
|
||||||
return callback();
|
return callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user