Move displayed event to view.

Jonathan Frederic 12 years ago
parent fa39d91446
commit df47869fb0

@ -86,6 +86,7 @@
cell.widget_area.show();
this._handle_display_view(view);
cell.widget_subarea.append(view.$el);
view.trigger('displayed');
}
}
};

@ -83,7 +83,6 @@ function(WidgetManager, _, Backbone){
break;
case 'display':
this.widget_manager.display_view(msg, this);
this.trigger('displayed');
break;
}
},

@ -30,11 +30,11 @@ define(["widgets/js/widget"], function(WidgetManager) {
// Trigger model displayed events for any models that are child to
// this model when this model is displayed.
var that = this;
this.model.on('displayed', function(){
this.on('displayed', function(){
that.is_displayed = true;
for (var property in that.child_views) {
if (that.child_views.hasOwnProperty(property)) {
that.child_views[property].model.trigger('displayed');
that.child_views[property].trigger('displayed');
}
}
});
@ -60,7 +60,7 @@ define(["widgets/js/widget"], function(WidgetManager) {
// Trigger the displayed event if this model is displayed.
if (this.is_displayed) {
model.trigger('displayed');
view.trigger('displayed');
}
},
@ -192,11 +192,11 @@ define(["widgets/js/widget"], function(WidgetManager) {
// Trigger model displayed events for any models that are child to
// this model when this model is displayed.
this.model.on('displayed', function(){
this.on('displayed', function(){
that.is_displayed = true;
for (var property in that.child_views) {
if (that.child_views.hasOwnProperty(property)) {
that.child_views[property].model.trigger('displayed');
that.child_views[property].trigger('displayed');
}
}
});
@ -264,7 +264,7 @@ define(["widgets/js/widget"], function(WidgetManager) {
// Trigger the displayed event if this model is displayed.
if (this.is_displayed) {
model.trigger('displayed');
view.trigger('displayed');
}
},

@ -36,14 +36,14 @@ define(["widgets/js/widget"], function(WidgetManager){
this.update_titles(value);
}, this);
var that = this;
this.model.on('displayed', function() {
this.on('displayed', function() {
this.update_titles();
// Trigger model displayed events for any models that are child to
// this model when this model is displayed.
that.is_displayed = true;
for (var property in that.child_views) {
if (that.child_views.hasOwnProperty(property)) {
that.child_views[property].model.trigger('displayed');
that.child_views[property].trigger('displayed');
}
}
}, this);
@ -137,7 +137,7 @@ define(["widgets/js/widget"], function(WidgetManager){
// Trigger the displayed event if this model is displayed.
if (this.is_displayed) {
model.trigger('displayed');
view.trigger('displayed');
}
},
});
@ -170,11 +170,11 @@ define(["widgets/js/widget"], function(WidgetManager){
// Trigger model displayed events for any models that are child to
// this model when this model is displayed.
this.model.on('displayed', function(){
this.on('displayed', function(){
that.is_displayed = true;
for (var property in that.child_views) {
if (that.child_views.hasOwnProperty(property)) {
that.child_views[property].model.trigger('displayed');
that.child_views[property].trigger('displayed');
}
}
});
@ -233,7 +233,7 @@ define(["widgets/js/widget"], function(WidgetManager){
// Trigger the displayed event if this model is displayed.
if (this.is_displayed) {
model.trigger('displayed');
view.trigger('displayed');
}
},

Loading…
Cancel
Save