mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +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;
|
quiet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
app.leaveCurrentRoom();
|
ajaxify.cleanup(url, ajaxify.data.template.name);
|
||||||
|
|
||||||
$(window).off('scroll');
|
|
||||||
|
|
||||||
if ($('#content').hasClass('ajaxifying') && apiXHR) {
|
if ($('#content').hasClass('ajaxifying') && apiXHR) {
|
||||||
apiXHR.abort();
|
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) {
|
require(['translator', 'benchpress'], function (translator, Benchpress) {
|
||||||
translator.translate('[[error:no-connection]]');
|
translator.translate('[[error:no-connection]]');
|
||||||
translator.translate('[[error:socket-reconnect-failed]]');
|
translator.translate('[[error:socket-reconnect-failed]]');
|
||||||
|
|||||||
Reference in New Issue
Block a user