mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
feat: add client-side static hook to fire immediately before any topic action (hint: delete action to stop default behaviour)
This commit is contained in:
@@ -399,7 +399,12 @@ define('forum/topic/postTools', [
|
||||
postAction('purge', getData(button, 'data-pid'));
|
||||
}
|
||||
|
||||
function postAction(action, pid) {
|
||||
async function postAction(action, pid) {
|
||||
({ action } = await hooks.fire(`static:post.${action}`, { action, pid }));
|
||||
if (!action) {
|
||||
return;
|
||||
}
|
||||
|
||||
bootbox.confirm('[[topic:post_' + action + '_confirm]]', function (confirm) {
|
||||
if (!confirm) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user