Revision f9f43e09
b/snf-cyclades-app/synnefo/ui/static/snf/js/views.js | ||
---|---|---|
67 | 67 |
post_hide: function() {}, |
68 | 68 |
|
69 | 69 |
initialize: function(options) { |
70 |
views.View.__super__.initialize.apply(this, arguments);
|
|
70 |
views.View.__super__.initialize.apply(this, [options]);
|
|
71 | 71 |
this.log = new snf.logging.logger("SNF-VIEWS:" + this.view_id); |
72 | 72 |
this.parent_view = options && options.parent_view; |
73 | 73 |
}, |
b/snf-cyclades-app/synnefo/ui/static/snf/js/views_ext.js | ||
---|---|---|
35 | 35 |
post_init: function() {}, |
36 | 36 |
|
37 | 37 |
initialize: function(options) { |
38 |
views.ext.View.__super__.initialize.apply(this, arguments); |
|
38 | 39 |
this.container = options && options.container; |
39 | 40 |
this._subviews = []; |
40 | 41 |
if (this.tpl) { |
... | ... | |
124 | 125 |
|
125 | 126 |
rivets_unbind: function() { |
126 | 127 |
if (!this.rivets_view) { return } |
128 |
if (!this.rivets) { return } |
|
127 | 129 |
this.rivets.unbind(); |
128 | 130 |
}, |
129 | 131 |
|
... | ... | |
345 | 347 |
// make it visible by default |
346 | 348 |
this.add_subview(view); |
347 | 349 |
view.show(true); |
350 |
this.post_add_model_view(view, model); |
|
348 | 351 |
}, |
349 |
|
|
352 |
post_add_model_view: function() {}, |
|
353 |
|
|
350 | 354 |
each_model_view: function(cb, context) { |
351 | 355 |
if (!context) { context = this }; |
352 | 356 |
_.each(this._model_views, function(view, model_id){ |
... | ... | |
356 | 360 |
}, |
357 | 361 |
|
358 | 362 |
remove_model: function(m) { |
359 |
console.log("REMOVING MODEL", m); |
|
360 | 363 |
var model_view = this._model_views[m.id]; |
361 | 364 |
if (!model_view) { |
362 | 365 |
console.error("no view found"); |
... | ... | |
365 | 368 |
model_view.hide(); |
366 | 369 |
model_view.el.remove(); |
367 | 370 |
this.remove_view(model_view); |
371 |
this.post_remove_model_view(model_view, model); |
|
368 | 372 |
delete this._model_views[m.id]; |
369 | 373 |
this.check_empty(); |
370 | 374 |
}, |
371 | 375 |
|
376 |
post_remove_model_view: function() {}, |
|
377 |
|
|
372 | 378 |
update_models: function(m) { |
373 | 379 |
this.check_empty(); |
374 | 380 |
this.collection.each(function(model, index) { |
Also available in: Unified diff