##// END OF EJS Templates
Fixed widget.js and notebook.js so IPython.notebook.widget_manager is created.
Jonathan Frederic -
Show More
@@ -1288,25 +1288,19 b' var IPython = (function (IPython) {'
1288 *
1288 *
1289 * @method start_session
1289 * @method start_session
1290 */
1290 */
1291 Notebook.prototype.start_session = function () {
1291 Notebook.prototype.start_kernel = function () {
1292 this.session = new IPython.Session(this.notebook_name, this.notebook_path, this);
1292 var base_url = $('body').data('baseKernelUrl') + "kernels";
1293 this.session.start($.proxy(this._session_started, this));
1293 this.kernel = new IPython.Kernel(base_url);
1294 };
1294 this.kernel.start({notebook: this.notebook_id});
1295
1295 // Now that the kernel has been created, tell the CodeCells about it.
1296
1297 /**
1298 * Once a session is started, link the code cells to the kernel
1299 *
1300 */
1301 Notebook.prototype._session_started = function(){
1302 this.kernel = this.session.kernel;
1303 var ncells = this.ncells();
1296 var ncells = this.ncells();
1304 for (var i=0; i<ncells; i++) {
1297 for (var i=0; i<ncells; i++) {
1305 var cell = this.get_cell(i);
1298 var cell = this.get_cell(i);
1306 if (cell instanceof IPython.CodeCell) {
1299 if (cell instanceof IPython.CodeCell) {
1307 cell.set_kernel(this.session.kernel);
1300 cell.set_kernel(this.session.kernel);
1308 };
1301 };
1309 };
1302 };
1303 this.widget_manager = IPython.WidgetManager(this.kernel.comm_manager);
1310 };
1304 };
1311
1305
1312 /**
1306 /**
@@ -19,7 +19,7 b''
19 // require(['components/underscore/underscore-min.js',
19 // require(['components/underscore/underscore-min.js',
20 // 'components/backbone/backbone-min.js'],
20 // 'components/backbone/backbone-min.js'],
21
21
22 var IPython = function (IPython) {
22 var IPython = (function (IPython) {
23 "use strict";
23 "use strict";
24
24
25 //-----------------------------------------------------------------------
25 //-----------------------------------------------------------------------
@@ -224,6 +224,7 b' var IPython = function (IPython) {'
224 IPython.WidgetModel = WidgetModel;
224 IPython.WidgetModel = WidgetModel;
225 IPython.WidgetView = WidgetView;
225 IPython.WidgetView = WidgetView;
226
226
227
227 return IPython;
228 return IPython;
228
229
229 };
230 }(IPython));
General Comments 0
You need to be logged in to leave comments. Login now