mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
make the saving to python a method of the model, called with callbacks
Conflicts: IPython/html/static/notebook/js/widgets/widget.js
This commit is contained in:
parent
24ec0da125
commit
092e40df32
@ -171,6 +171,13 @@ function(widget_manager, underscore, backbone){
|
||||
return model_json;
|
||||
},
|
||||
|
||||
push: function(callbacks) {
|
||||
// Push this model's state to the back-end
|
||||
//
|
||||
// This invokes a Backbone.Sync.
|
||||
this.save(this.changedAttributes(), {patch: true, callbacks: callbacks});
|
||||
},
|
||||
|
||||
_pack_models: function(value) {
|
||||
// Replace models with model ids recursively.
|
||||
if (value instanceof Backbone.Model) {
|
||||
@ -288,8 +295,7 @@ function(widget_manager, underscore, backbone){
|
||||
},
|
||||
|
||||
touch: function () {
|
||||
// Associate recent model changes with this notebook.
|
||||
this.model.save(this.model.changedAttributes(), {patch: true, callbacks: this.callbacks()});
|
||||
this.model.push(this.callbacks());
|
||||
},
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user