potential fix for templates bug

v1.18.x
psychobunny 12 years ago
parent 6cd65e6598
commit 17cde19020

@ -2,8 +2,7 @@
(function (module) { (function (module) {
var ready_callback, var config = {},
config = {},
templates, templates,
fs = null, fs = null,
available_templates = []; available_templates = [];
@ -35,8 +34,19 @@
}; };
templates.ready = function(callback) { templates.ready = function(callback) {
if (callback == null && ready_callback) ready_callback(); if (callback == null) {
else ready_callback = callback; if (this.ready_callback) {
this.ready_callback();
} else {
this.loaded = true;
}
} else {
if (this.loaded == true) {
callback();
} else {
this.ready_callback = callback;
}
}
}; };
templates.prepare = function(raw_tpl, data) { templates.prepare = function(raw_tpl, data) {

Loading…
Cancel
Save