feat: allow hook unregistration, and temporary page-based hooks

Temporary hooks automatically unregister themselves on the next ajaxify, making them perfect for in-page events.
This commit is contained in:
Julian Lam
2021-02-23 15:15:54 -05:00
parent de6d156533
commit d0136074b6
2 changed files with 28 additions and 1 deletions

View File

@@ -113,7 +113,9 @@ ajaxify = window.ajaxify || {};
url: url,
};
$(window).trigger('action:ajaxify.start', payload);
require(['hooks'], function (hooks) {
hooks.fire('action:ajaxify.start', payload);
});
ajaxify.count += 1;