Cherry pick of @jasongrout 's 2bc2f96.

Only merged changes to notebook and kernel...  (see original comment below).

Separate the widget registry from the widget managers;
attach widget managers to kernels.

Yet to do: take care of clean-up when a kernel is deleted
Conflicts:
	IPython/html/static/notebook/js/widgetmanager.js
	IPython/html/static/notebook/js/widgets/widget.js
This commit is contained in:
Jonathan Frederic 2014-01-17 15:36:49 +00:00
parent 140d1872f7
commit 6871c8f9e0
2 changed files with 3 additions and 1 deletions

View File

@ -1315,7 +1315,6 @@ var IPython = (function (IPython) {
*/
Notebook.prototype._session_started = function(){
this.kernel = this.session.kernel;
IPython.widget_manager.attach_comm_manager(this.kernel.comm_manager);
var ncells = this.ncells();
for (var i=0; i<ncells; i++) {
var cell = this.get_cell(i);

View File

@ -47,6 +47,9 @@ var IPython = (function (IPython) {
this.bind_events();
this.init_iopub_handlers();
this.comm_manager = new IPython.CommManager(this);
// TODO: make the comm manager an arg to the widget manager initialization
this.widget_manager = new IPython.WidgetManager();
this.widget_manager.attach_comm_manager(this.comm_manager);
};