Roo/Template.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 6 Apr 2012 15:20:33 +0000 (23:20 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 6 Apr 2012 15:20:33 +0000 (23:20 +0800)
Roo/Template.js

index 73f962b..bfcc6cd 100644 (file)
@@ -105,12 +105,18 @@ Roo.Template.prototype = {
         if (this.loading) {
             return;
         }
+        this.loading = true;
+        var _t = this;
         var cx = new Roo.data.Connection({
             url : url,
             method : 'GET',
-            success : success,
+            success : function () {
+                _t.loading = false;
+                success && success();
+            },
             failure : function() {
-                Roo.log("Template failed to load from " + url);  
+                Roo.log("Template failed to load from " + url);
+                _t.loading = false;
             }
         });
     },