mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 10:06:52 +02:00
refactor: get rid of helper function
This commit is contained in:
@@ -324,22 +324,17 @@ define('forum/topic/postTools', [
|
|||||||
const username = getUserSlug(button);
|
const username = getUserSlug(button);
|
||||||
const toPid = getData(button, 'data-pid');
|
const toPid = getData(button, 'data-pid');
|
||||||
|
|
||||||
function quote(text) {
|
const body = selectedNode.text && toPid && toPid === selectedNode.pid ?
|
||||||
hooks.fire('action:composer.addQuote', {
|
selectedNode.text :
|
||||||
tid: tid,
|
(await api.get(`/posts/${encodeURIComponent(toPid)}/raw`)).content;
|
||||||
pid: toPid,
|
|
||||||
username: username,
|
|
||||||
title: ajaxify.data.titleRaw,
|
|
||||||
text: text,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedNode.text && toPid && toPid === selectedNode.pid) {
|
hooks.fire('action:composer.addQuote', {
|
||||||
return quote(selectedNode.text);
|
tid: tid,
|
||||||
}
|
pid: toPid,
|
||||||
|
username: username,
|
||||||
const { content } = await api.get(`/posts/${encodeURIComponent(toPid)}/raw`);
|
title: ajaxify.data.titleRaw,
|
||||||
quote(content);
|
body: body,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user