refactor: move hooks to top

This commit is contained in:
Barış Soner Uşaklı
2022-02-22 19:02:55 -05:00
parent e190ff875a
commit 1523d0cc50

View File

@@ -1,5 +1,6 @@
'use strict';
const hooks = require('./modules/hooks');
const { render } = require('./widgets');
window.ajaxify = window.ajaxify || {};
@@ -14,11 +15,6 @@ ajaxify.widgets = { render: render };
ajaxify.count = 0;
ajaxify.currentPage = null;
let hooks;
require(['hooks'], function (_hooks) {
hooks = _hooks;
});
ajaxify.go = function (url, callback, quiet) {
// Automatically reconnect to socket and re-ajaxify on success
if (!socket.connected) {
@@ -469,11 +465,6 @@ ajaxify.widgets = { render: render };
}());
$(document).ready(function () {
let hooks;
require(['hooks'], function (_hooks) {
hooks = _hooks;
});
$(window).on('popstate', function (ev) {
ev = ev.originalEvent;