Show More
@@ -72,15 +72,17 b'' | |||||
72 | }; |
|
72 | }; | |
73 |
|
73 | |||
74 |
|
74 | |||
75 |
WidgetManager.prototype.display_view = function(msg |
|
75 | WidgetManager.prototype.display_view = function(msg, model) { | |
76 | var cell = this.get_msg_cell(msg_id); |
|
76 | var cell = this.get_msg_cell(msg.parent_header.msg_id); | |
77 | if (cell === null) { |
|
77 | if (cell === null) { | |
78 | console.log("Could not determine where the display" + |
|
78 | console.log("Could not determine where the display" + | |
79 | " message was from. Widget will not be displayed"); |
|
79 | " message was from. Widget will not be displayed"); | |
80 | } else { |
|
80 | } else { | |
81 | var view = this.create_view(model, {cell: cell}); |
|
81 | var view = this.create_view(model, {cell: cell}); | |
82 |
if (view |
|
82 | if (view === undefined) { | |
83 | && cell.widget_subarea !== undefined |
|
83 | console.error("View creation failed", model); | |
|
84 | } | |||
|
85 | if (cell.widget_subarea !== undefined | |||
84 | && cell.widget_subarea !== null) { |
|
86 | && cell.widget_subarea !== null) { | |
85 |
|
87 | |||
86 | cell.widget_area.show(); |
|
88 | cell.widget_area.show(); |
@@ -79,7 +79,7 b' function(widget_manager, underscore, backbone){' | |||||
79 | this.trigger('msg:custom', msg.content.data.custom_content); |
|
79 | this.trigger('msg:custom', msg.content.data.custom_content); | |
80 | break; |
|
80 | break; | |
81 | case 'display': |
|
81 | case 'display': | |
82 |
this.widget_manager.display_view(msg |
|
82 | this.widget_manager.display_view(msg, this); | |
83 | break; |
|
83 | break; | |
84 | } |
|
84 | } | |
85 | }, |
|
85 | }, |
General Comments 0
You need to be logged in to leave comments.
Login now