diff --git a/IPython/html/static/notebook/js/widgets/widget.js b/IPython/html/static/notebook/js/widgets/widget.js index 5b4c3de..f98aa97 100644 --- a/IPython/html/static/notebook/js/widgets/widget.js +++ b/IPython/html/static/notebook/js/widgets/widget.js @@ -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); diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py index 4a9c996..a88b502 100644 --- a/IPython/html/widgets/widget.py +++ b/IPython/html/widgets/widget.py @@ -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."""