equal
deleted
inserted
replaced
140 IriSP.configureWidgets = function (popcornInstance, layoutManager, guiOptions) { |
140 IriSP.configureWidgets = function (popcornInstance, layoutManager, guiOptions) { |
141 |
141 |
142 var serialFactory = new IriSP.SerializerFactory(IriSP.__dataloader); |
142 var serialFactory = new IriSP.SerializerFactory(IriSP.__dataloader); |
143 var params = {width: guiOptions.width, height: guiOptions.height}; |
143 var params = {width: guiOptions.width, height: guiOptions.height}; |
144 |
144 |
|
145 var default_options = guiOptions.default_options; |
|
146 if (IriSP.null_or_undefined(default_options)) |
|
147 default_options = {}; |
|
148 |
145 var ret_widgets = []; |
149 var ret_widgets = []; |
146 var index; |
150 var index; |
147 |
151 |
148 for (index = 0; index < guiOptions.widgets.length; index++) { |
152 for (index = 0; index < guiOptions.widgets.length; index++) { |
149 var widgetConfig = guiOptions.widgets[index]; |
153 var widgetConfig = IriSP.underscore.defaults(guiOptions.widgets[index], default_options); |
150 var widget = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, widgetConfig); |
154 var widget = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, widgetConfig); |
151 |
155 |
152 ret_widgets.push(widget); |
156 ret_widgets.push(widget); |
153 }; |
157 }; |
154 |
158 |
155 return ret_widgets; |
159 return ret_widgets; |
156 }; |
160 }; |