mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-12 23:50:47 +01:00
refactor: get rid of template500Function
This commit is contained in:
@@ -425,12 +425,7 @@ ajaxify.widgets = { render: render };
|
||||
});
|
||||
};
|
||||
|
||||
let template500Function = null;
|
||||
|
||||
ajaxify.loadTemplate = function (template, callback) {
|
||||
if (template === '500' && template500Function) {
|
||||
return callback(template500Function);
|
||||
}
|
||||
$.ajax({
|
||||
url: `${config.asset_base_url}/templates/${template}.js`,
|
||||
dataType: 'text',
|
||||
@@ -458,9 +453,7 @@ ajaxify.widgets = { render: render };
|
||||
translator.translate(`[[global:reconnecting-message, ${config.siteTitle}]]`);
|
||||
Benchpress.registerLoader(ajaxify.loadTemplate);
|
||||
Benchpress.setGlobal('config', config);
|
||||
ajaxify.loadTemplate('500', function (renderFunction) {
|
||||
template500Function = renderFunction;
|
||||
});
|
||||
Benchpress.render('500', {}); // loads and caches the 500.tpl
|
||||
});
|
||||
}());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user