rename widgetCollection#ready to widgetCollection#initialized

This commit is contained in:
Raphael Sofaer 2011-04-07 18:23:24 -07:00
parent ea932c8706
commit d23ac3468b

View file

@ -6,12 +6,15 @@
var Diaspora = Diaspora || {};
Diaspora.widgetCollection = function() {
this.ready = false;
this.initialized = false;
this.collection = {};
};
Diaspora.widgetCollection.prototype.add = function(widgetId, widget) {
this[widgetId] = this.collection[widgetId] = new widget();
if(this.initialized) {
this.collection[widgetId].start();
}
};
Diaspora.widgetCollection.prototype.remove = function(widgetId) {
@ -19,7 +22,7 @@ Diaspora.widgetCollection.prototype.remove = function(widgetId) {
};
Diaspora.widgetCollection.prototype.init = function() {
this.ready = true;
this.initialized = true;
for(var widgetId in this.collection) {
this.collection[widgetId].start();
}