added app alert if template data cant be loaded

v1.18.x
Baris Usakli 12 years ago
parent 9f67282a79
commit 4207792ffd

@ -124,7 +124,6 @@
var template_data = null; var template_data = null;
(function () {
var timestamp = new Date().getTime(); //debug var timestamp = new Date().getTime(); //debug
if (!templates[tpl_url]) { if (!templates[tpl_url]) {
@ -147,9 +146,6 @@
parse_template(); parse_template();
} }
}());
(function () {
jQuery.get(RELATIVE_PATH + '/api/' + api_url, function (data) { jQuery.get(RELATIVE_PATH + '/api/' + api_url, function (data) {
if (!data) { if (!data) {
@ -160,11 +156,8 @@
template_data = data; template_data = data;
parse_template(); parse_template();
}).fail(function (data) { }).fail(function (data) {
template_data = {}; app.alertError("Can't load template data!");
parse_template();
}); });
}());
function parse_template() { function parse_template() {
if (!templates[tpl_url] || !template_data) return; if (!templates[tpl_url] || !template_data) return;

Loading…
Cancel
Save