Fixed widget.js and notebook.js so IPython.notebook.widget_manager is created.

Jonathan Frederic 12 years ago
parent 0230fa8c09
commit a576a0c8a1

@ -1288,25 +1288,19 @@ var IPython = (function (IPython) {
*
* @method start_session
*/
Notebook.prototype.start_session = function () {
this.session = new IPython.Session(this.notebook_name, this.notebook_path, this);
this.session.start($.proxy(this._session_started, this));
};
/**
* Once a session is started, link the code cells to the kernel
*
*/
Notebook.prototype._session_started = function(){
this.kernel = this.session.kernel;
Notebook.prototype.start_kernel = function () {
var base_url = $('body').data('baseKernelUrl') + "kernels";
this.kernel = new IPython.Kernel(base_url);
this.kernel.start({notebook: this.notebook_id});
// Now that the kernel has been created, tell the CodeCells about it.
var ncells = this.ncells();
for (var i=0; i<ncells; i++) {
var cell = this.get_cell(i);
if (cell instanceof IPython.CodeCell) {
cell.set_kernel(this.session.kernel);
};
};
};
this.widget_manager = IPython.WidgetManager(this.kernel.comm_manager);
};
/**

@ -19,7 +19,7 @@
// require(['components/underscore/underscore-min.js',
// 'components/backbone/backbone-min.js'],
var IPython = function (IPython) {
var IPython = (function (IPython) {
"use strict";
//-----------------------------------------------------------------------
@ -224,6 +224,7 @@ var IPython = function (IPython) {
IPython.WidgetModel = WidgetModel;
IPython.WidgetView = WidgetView;
return IPython;
};
}(IPython));

Loading…
Cancel
Save