Show More
@@ -54,7 +54,7 b' function(WidgetManager, Underscore, Backbone){' | |||
|
54 | 54 | send: function (content, callbacks) { |
|
55 | 55 | // Send a custom msg over the comm. |
|
56 | 56 | if (this.comm !== undefined) { |
|
57 |
var data = {method: 'custom', |
|
|
57 | var data = {method: 'custom', content: content}; | |
|
58 | 58 | this.comm.send(data, callbacks); |
|
59 | 59 | } |
|
60 | 60 | }, |
@@ -76,7 +76,7 b' function(WidgetManager, Underscore, Backbone){' | |||
|
76 | 76 | this.apply_update(msg.content.data.state); |
|
77 | 77 | break; |
|
78 | 78 | case 'custom': |
|
79 |
this.trigger('msg:custom', msg.content.data. |
|
|
79 | this.trigger('msg:custom', msg.content.data.content); | |
|
80 | 80 | break; |
|
81 | 81 | case 'display': |
|
82 | 82 | this.widget_manager.display_view(msg, this); |
@@ -153,7 +153,7 b' class Widget(LoggingConfigurable):' | |||
|
153 | 153 | content : dict |
|
154 | 154 | Content of the message to send. |
|
155 | 155 | """ |
|
156 |
self._send({"method": "custom", " |
|
|
156 | self._send({"method": "custom", "content": content}) | |
|
157 | 157 | |
|
158 | 158 | def on_msg(self, callback, remove=False): |
|
159 | 159 | """(Un)Register a custom msg recieve callback. |
@@ -249,8 +249,8 b' class Widget(LoggingConfigurable):' | |||
|
249 | 249 | |
|
250 | 250 | # Handle a custom msg from the front-end |
|
251 | 251 | elif method == 'custom': |
|
252 |
if ' |
|
|
253 |
self._handle_custom_msg(data[' |
|
|
252 | if 'content' in data: | |
|
253 | self._handle_custom_msg(data['content']) | |
|
254 | 254 | |
|
255 | 255 | def _handle_receive_state(self, sync_data): |
|
256 | 256 | """Called when a state is received from the front-end.""" |
General Comments 0
You need to be logged in to leave comments.
Login now