do one api call for template configs rather than two on cold load

This commit is contained in:
psychobunny
2014-08-05 17:16:18 -04:00
parent 631edc92d3
commit a880ac6e9f
2 changed files with 17 additions and 8 deletions

View File

@@ -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();
});