##// END OF EJS Templates
handle_msg a display_model method.
Jonathan Frederic -
Show More
@@ -71,11 +71,8
71 };
71 };
72
72
73
73
74 WidgetManager.prototype.handle_msg = function(msg, model) {
74 WidgetManager.prototype.display_view = function(msg_id, model) {
75 var method = msg.content.data.method;
75 var cell = this.get_msg_cell(msg_id);
76 switch (method) {
77 case 'display':
78 var cell = this.get_msg_cell(msg.parent_header.msg_id);
79 if (cell === null) {
76 if (cell === null) {
80 console.log("Could not determine where the display" +
77 console.log("Could not determine where the display" +
81 " message was from. Widget will not be displayed");
78 " message was from. Widget will not be displayed");
@@ -90,9 +87,8
90 cell.widget_subarea.append(view.$el);
87 cell.widget_subarea.append(view.$el);
91 }
88 }
92 }
89 }
93 break;
90 },
94 }
91
95 }
96
92
97 <<<<<<< HEAD
93 <<<<<<< HEAD
98 <<<<<<< HEAD
94 <<<<<<< HEAD
@@ -174,6 +170,7
174 }
170 }
175 },
171 },
176
172
173
177 WidgetManager.prototype.get_msg_cell = function (msg_id) {
174 WidgetManager.prototype.get_msg_cell = function (msg_id) {
178 var cell = null;
175 var cell = null;
179 // First, check to see if the msg was triggered by cell execution.
176 // First, check to see if the msg was triggered by cell execution.
@@ -70,9 +70,9 function(widget_manager, underscore, backbone){
70 case 'custom':
70 case 'custom':
71 this.trigger('msg:custom', msg.content.data.custom_content);
71 this.trigger('msg:custom', msg.content.data.custom_content);
72 break;
72 break;
73 default:
73 case 'display':
74 // pass on to widget manager
74 this.widget_manager.display_view(msg.parent_header.msg_id, this);
75 this.widget_manager.handle_msg(msg, this);
75 break;
76 }
76 }
77 },
77 },
78
78
General Comments 0
You need to be logged in to leave comments. Login now