make a widget's start method optional

This commit is contained in:
Dan Hansen 2011-04-15 18:14:38 -05:00
parent 2eaf5abf32
commit c0cd8fafff

View file

@ -28,8 +28,11 @@
Diaspora.WidgetCollection.prototype.init = function() { Diaspora.WidgetCollection.prototype.init = function() {
this.initialized = true; this.initialized = true;
for(var widgetId in this.collection) { for(var widgetId in this.collection) {
this.collection[widgetId].start(); if(this.collection[widgetId].hasOwnProperty("start")) {
this.collection[widgetId].start();
}
} }
}; };