diff --git a/IPython/html/static/notebook/js/widgetmanager.js b/IPython/html/static/notebook/js/widgetmanager.js index d0e6a11..80c4d11 100644 --- a/IPython/html/static/notebook/js/widgetmanager.js +++ b/IPython/html/static/notebook/js/widgetmanager.js @@ -166,6 +166,7 @@ }; WidgetManager.prototype.get_model = function (model_id) { + // Look-up a model instance by its id. var model = this._models[model_id]; if (model !== undefined && model.id == model_id) { return model; @@ -174,6 +175,7 @@ }; WidgetManager.prototype._handle_comm_open = function (comm, msg) { + // Handle when a comm is opened. var model_id = comm.comm_id; var widget_type_name = msg.content.target_name; var widget_model = new WidgetManager._model_types[widget_type_name](this, model_id, comm); diff --git a/IPython/html/static/notebook/js/widgets/widget.js b/IPython/html/static/notebook/js/widgets/widget.js index a9d5c37..f4cf76a 100644 --- a/IPython/html/static/notebook/js/widgets/widget.js +++ b/IPython/html/static/notebook/js/widgets/widget.js @@ -132,6 +132,7 @@ function(WidgetManager, Underscore, Backbone){ }, sync: function (method, model, options) { + // Handle sync to the back-end. Called when a model.save() is called. // Make sure a comm exists. var error = options.error || function() { @@ -315,7 +316,6 @@ function(WidgetManager, Underscore, Backbone){ touch: function () { this.model.save_changes(this.callbacks()); }, - });