diff --git a/IPython/html/static/widgets/js/manager.js b/IPython/html/static/widgets/js/manager.js index d1af78c..4aba4d2 100644 --- a/IPython/html/static/widgets/js/manager.js +++ b/IPython/html/static/widgets/js/manager.js @@ -86,6 +86,7 @@ cell.widget_area.show(); this._handle_display_view(view); cell.widget_subarea.append(view.$el); + view.trigger('displayed'); } } }; diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index 8752285..ce06396 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -83,7 +83,6 @@ function(WidgetManager, _, Backbone){ break; case 'display': this.widget_manager.display_view(msg, this); - this.trigger('displayed'); break; } }, diff --git a/IPython/html/static/widgets/js/widget_container.js b/IPython/html/static/widgets/js/widget_container.js index 57d2650..02bcf03 100644 --- a/IPython/html/static/widgets/js/widget_container.js +++ b/IPython/html/static/widgets/js/widget_container.js @@ -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'); } }, diff --git a/IPython/html/static/widgets/js/widget_selectioncontainer.js b/IPython/html/static/widgets/js/widget_selectioncontainer.js index 651a631..7dd49e0 100644 --- a/IPython/html/static/widgets/js/widget_selectioncontainer.js +++ b/IPython/html/static/widgets/js/widget_selectioncontainer.js @@ -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'); } },