mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
do one api call for template configs rather than two on cold load
This commit is contained in:
@@ -329,9 +329,9 @@ var ajaxify = ajaxify || {};
|
||||
|
||||
templates.registerLoader(ajaxify.loadTemplate);
|
||||
|
||||
$.when($.getJSON(RELATIVE_PATH + '/templates/config.json'), $.getJSON(RELATIVE_PATH + '/api/get_templates_listing')).done(function (config_data, templates_data) {
|
||||
templatesConfig = config_data[0];
|
||||
availableTemplates = templates_data[0];
|
||||
$.getJSON(RELATIVE_PATH + '/api/get_templates_listing', function (data) {
|
||||
templatesConfig = data.templatesConfig;
|
||||
availableTemplates = data.availableTemplates;
|
||||
|
||||
app.load();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user