mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
s/custom_content/content
This commit is contained in:
parent
5fe860ed26
commit
cb6094281c
@ -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);
|
||||
|
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user