src/js/init.js
branchpopcorn-port
changeset 810 85a278e12495
parent 795 8b69c3dbbc18
child 811 b9dd62e35e30
--- a/src/js/init.js	Tue Feb 14 17:14:57 2012 +0100
+++ b/src/js/init.js	Tue Feb 14 17:15:13 2012 +0100
@@ -142,13 +142,17 @@
   var serialFactory = new IriSP.SerializerFactory(IriSP.__dataloader);
   var params = {width: guiOptions.width, height: guiOptions.height};
 
+  var default_options = guiOptions.default_options;
+  if (IriSP.null_or_undefined(default_options))
+    default_options = {};
+  
   var ret_widgets = [];
   var index;
   
   for (index = 0; index < guiOptions.widgets.length; index++) {    
-    var widgetConfig = guiOptions.widgets[index];
+    var widgetConfig = IriSP.underscore.defaults(guiOptions.widgets[index], default_options);
     var widget = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, widgetConfig);
-        
+   
     ret_widgets.push(widget);   
   };