mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 00:56:13 +01:00
refactor: added new ajaxify method .cleanup, called before ajaxify.start.
This commit is contained in:
@@ -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]]');
|
||||
|
||||
Reference in New Issue
Block a user