Solving #5997: instances of WidgetView (that are not instances of DOMWidgetView) do not trigger widget_area.show anymore.

This commit is contained in:
Sylvain Corlay 2014-07-11 12:55:56 -04:00
parent 96832f6aca
commit 70cacc642a
2 changed files with 11 additions and 3 deletions

View File

@ -66,12 +66,11 @@ define([
if (view === null) {
console.error("View creation failed", model);
}
this._handle_display_view(view);
if (cell.widget_subarea) {
cell.widget_area.show();
this._handle_display_view(view);
cell.widget_subarea.append(view.$el);
view.trigger('displayed');
}
view.trigger('displayed');
}
};

View File

@ -370,6 +370,14 @@ define(["widgets/js/manager",
// By default, this is only called the first time the view is created
},
show: function(){
// Show the widget-area
if (this.options && this.options.cell &&
this.options.cell.widget_area !== undefined) {
this.options.cell.widget_area.show();
}
},
send: function (content) {
// Send a custom msg associated with this view.
this.model.send(content, this.callbacks());
@ -390,6 +398,7 @@ define(["widgets/js/manager",
this.model.on('change', this.update, this);
this.model.on('msg:custom', this.on_msg, this);
DOMWidgetView.__super__.initialize.apply(this, arguments);
this.on('displayed', this.show, this);
},
on_msg: function(msg) {