refactor: added new ajaxify method .cleanup, called before ajaxify.start.

isekai-main
Julian Lam 2 years ago
parent 0debc51b8f
commit 3700174c62

@ -44,9 +44,7 @@ ajaxify.widgets = { render: render };
quiet = true;
}
app.leaveCurrentRoom();
$(window).off('scroll');
ajaxify.cleanup(url, ajaxify.data.template.name);
if ($('#content').hasClass('ajaxifying') && apiXHR) {
apiXHR.abort();
@ -456,6 +454,12 @@ ajaxify.widgets = { render: render };
});
};
ajaxify.cleanup = (url, tpl_url) => {
app.leaveCurrentRoom();
$(window).off('scroll');
hooks.fire('action:ajaxify.cleanup', { url, tpl_url });
};
require(['translator', 'benchpress'], function (translator, Benchpress) {
translator.translate('[[error:no-connection]]');
translator.translate('[[error:socket-reconnect-failed]]');

Loading…
Cancel
Save