|
|
|
|
@ -71,28 +71,24 @@
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WidgetManager.prototype.handle_msg = function(msg, model) {
|
|
|
|
|
var method = msg.content.data.method;
|
|
|
|
|
switch (method) {
|
|
|
|
|
case 'display':
|
|
|
|
|
var cell = this.get_msg_cell(msg.parent_header.msg_id);
|
|
|
|
|
if (cell === null) {
|
|
|
|
|
console.log("Could not determine where the display" +
|
|
|
|
|
" message was from. Widget will not be displayed");
|
|
|
|
|
} else {
|
|
|
|
|
var view = this.create_view(model);
|
|
|
|
|
if (view !== undefined
|
|
|
|
|
&& cell.widget_subarea !== undefined
|
|
|
|
|
&& cell.widget_subarea !== null) {
|
|
|
|
|
|
|
|
|
|
view.cell = cell;
|
|
|
|
|
cell.widget_area.show();
|
|
|
|
|
cell.widget_subarea.append(view.$el);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
WidgetManager.prototype.display_view = function(msg_id, model) {
|
|
|
|
|
var cell = this.get_msg_cell(msg_id);
|
|
|
|
|
if (cell === null) {
|
|
|
|
|
console.log("Could not determine where the display" +
|
|
|
|
|
" message was from. Widget will not be displayed");
|
|
|
|
|
} else {
|
|
|
|
|
var view = this.create_view(model);
|
|
|
|
|
if (view !== undefined
|
|
|
|
|
&& cell.widget_subarea !== undefined
|
|
|
|
|
&& cell.widget_subarea !== null) {
|
|
|
|
|
|
|
|
|
|
view.cell = cell;
|
|
|
|
|
cell.widget_area.show();
|
|
|
|
|
cell.widget_subarea.append(view.$el);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
@ -174,6 +170,7 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WidgetManager.prototype.get_msg_cell = function (msg_id) {
|
|
|
|
|
var cell = null;
|
|
|
|
|
// First, check to see if the msg was triggered by cell execution.
|
|
|
|
|
|