This commit is contained in:
William Mantly 2016-02-08 10:13:03 -05:00
parent d438cdd249
commit a1a0ec8d02

10
lxc.js
View File

@ -188,17 +188,17 @@ var lxcORM = function(){
var containers = {} var containers = {}
this.isReady = false; this.isReady = false;
this.whenReady = []; this.whenReady = [];
var callthis = this; var that = this
this.list(function(data){ this.list(function(data){
for(var idx = data.length; idx--;){ for(var idx = data.length; idx--;){
containers[data[idx].name] = new Container(data[idx]); containers[data[idx].name] = new Container(data[idx]);
if(idx===0){ if(idx===0){
callthis.callReady(); that.callReady;
} }
} }
}); });
this.containers = containers this.containers = containers;
}; };
@ -207,7 +207,7 @@ lxcORM.prototype.callReady = function(){
this.whenReady[idx].apply(this); this.whenReady[idx].apply(this);
} }
this.isReady = true; this.isReady = true;
} };
lxcORM.prototype.ready = function(callback){ lxcORM.prototype.ready = function(callback){
if(this.isReady){ if(this.isReady){
@ -216,7 +216,7 @@ lxcORM.prototype.ready = function(callback){
else{ else{
this.whenReady.push(callback); this.whenReady.push(callback);
} }
} };
lxcORM.prototype.create = function(args, callback){ lxcORM.prototype.create = function(args, callback){