s/custom_content/content

This commit is contained in:
Jonathan Frederic 2014-01-21 14:17:57 -08:00
parent 5fe860ed26
commit cb6094281c
2 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ function(WidgetManager, Underscore, Backbone){
send: function (content, callbacks) {
// Send a custom msg over the comm.
if (this.comm !== undefined) {
var data = {method: 'custom', custom_content: content};
var data = {method: 'custom', content: content};
this.comm.send(data, callbacks);
}
},
@ -76,7 +76,7 @@ function(WidgetManager, Underscore, Backbone){
this.apply_update(msg.content.data.state);
break;
case 'custom':
this.trigger('msg:custom', msg.content.data.custom_content);
this.trigger('msg:custom', msg.content.data.content);
break;
case 'display':
this.widget_manager.display_view(msg, this);

View File

@ -153,7 +153,7 @@ class Widget(LoggingConfigurable):
content : dict
Content of the message to send.
"""
self._send({"method": "custom", "custom_content": content})
self._send({"method": "custom", "content": content})
def on_msg(self, callback, remove=False):
"""(Un)Register a custom msg recieve callback.
@ -249,8 +249,8 @@ class Widget(LoggingConfigurable):
# Handle a custom msg from the front-end
elif method == 'custom':
if 'custom_content' in data:
self._handle_custom_msg(data['custom_content'])
if 'content' in data:
self._handle_custom_msg(data['content'])
def _handle_receive_state(self, sync_data):
"""Called when a state is received from the front-end."""