feat: add client-side static hook to fire immediately before any topic action (hint: delete `action` to stop default behaviour)

isekai-main
Julian Lam 3 years ago
parent 819917daf2
commit 66eaae44a6

@ -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;

Loading…
Cancel
Save