From 5b388df615b2f440e4fbf8a968113d2051c29d6e Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Tue, 7 Jan 2014 14:03:02 +0000 Subject: [PATCH] Added callbacks method to view --- IPython/html/static/notebook/js/widgets/widget.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/IPython/html/static/notebook/js/widgets/widget.js b/IPython/html/static/notebook/js/widgets/widget.js index 2d6188bd0..b72620a0a 100644 --- a/IPython/html/static/notebook/js/widgets/widget.js +++ b/IPython/html/static/notebook/js/widgets/widget.js @@ -231,17 +231,19 @@ function(widget_manager, underscore, backbone){ }, this); }, - + callbacks: function(){ + return this.widget_manager.callbacks(this); + } render: function(){ // render the view. By default, this is only called the first time the view is created }, send: function (content) { - this.model.send(content, this.widget_manager.callbacks(this)); + this.model.send(content, this.callbacks()); }, touch: function () { - this.model.save(this.model.changedAttributes(), {patch: true, callbacks: this.widget_manager.callbacks(this)}); + this.model.save(this.model.changedAttributes(), {patch: true, callbacks: this.callbacks()}); }, });