rename widgetCollection#ready to widgetCollection#initialized
This commit is contained in:
parent
ea932c8706
commit
d23ac3468b
1 changed files with 5 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue