Show More
@@ -212,17 +212,20 b' define(["components/underscore/underscore-min",' | |||
|
212 | 212 | var parent_view = parent_views[parent_view_index]; |
|
213 | 213 | if (parent_view.display_child != undefined) { |
|
214 | 214 | var view = this._create_view(view_name, cell); |
|
215 | if (view != null) { | |
|
215 | 216 | new_views.push(view); |
|
216 | 217 | parent_view.display_child(view); |
|
217 | 218 | displayed = true; |
|
218 | 219 | } |
|
219 | 220 | } |
|
220 | 221 | } |
|
222 | } | |
|
221 | 223 | |
|
222 | 224 | if (!displayed) { |
|
223 | 225 | // No parent view is defined or exists. Add the view's |
|
224 | 226 | // element to cell's widget div. |
|
225 | 227 | var view = this._create_view(view_name, cell); |
|
228 | if (view != null) { | |
|
226 | 229 | new_views.push(view); |
|
227 | 230 | |
|
228 | 231 | if (cell.widget_subarea != undefined && cell.widget_subarea != null) { |
@@ -230,6 +233,7 b' define(["components/underscore/underscore-min",' | |||
|
230 | 233 | cell.widget_subarea.append(view.$el); |
|
231 | 234 | } |
|
232 | 235 | } |
|
236 | } | |
|
233 | 237 | |
|
234 | 238 | for (var view_index in new_views) { |
|
235 | 239 | var view = new_views[view_index]; |
@@ -240,7 +244,9 b' define(["components/underscore/underscore-min",' | |||
|
240 | 244 | |
|
241 | 245 | // Create a view |
|
242 | 246 | _create_view: function (view_name, cell) { |
|
243 |
var view = |
|
|
247 | var view_type = this.widget_manager.widget_view_types[view_name]; | |
|
248 | if (view_type != undefined && view_type != null) { | |
|
249 | var view = new view_type({model: this}); | |
|
244 | 250 | view.render(); |
|
245 | 251 | if (this.views[cell]==undefined) { |
|
246 | 252 | this.views[cell] = [] |
@@ -266,6 +272,8 b' define(["components/underscore/underscore-min",' | |||
|
266 | 272 | } |
|
267 | 273 | }); |
|
268 | 274 | return view; |
|
275 | } | |
|
276 | return null; | |
|
269 | 277 | }, |
|
270 | 278 | |
|
271 | 279 |
General Comments 0
You need to be logged in to leave comments.
Login now