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