Skip to content

Commit

Permalink
load widget extension in js
Browse files Browse the repository at this point in the history
previously was a plain require,
which doesn't actually register anything.
  • Loading branch information
minrk committed Jul 28, 2015
1 parent a36dcf2 commit ff191ae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions notebook/static/notebook/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ require([
"use strict";

// BEGIN HARDCODED WIDGETS HACK
// Don't include in above require call, avoiding r.js
// and crash on import failure.
require(['nbextensions/widgets/notebook/js/extension'], function(){}, function(err) {
console.error('ipywidgets package not installed. Widgets are not available.');

This comment has been minimized.

Copy link
@jdfreder

jdfreder Jul 28, 2015

Contributor

@minrk I don't understand why this didn't work, utils.load_extension calls require internally. Is it just the not needed nbextensions/ prefix?

This comment has been minimized.

Copy link
@takluyver

takluyver Jul 28, 2015

Member

load_extension() calls require, but then it also calls ext.load_ipython_extension();, which require doesn't.

This comment has been minimized.

Copy link
@jdfreder

jdfreder Jul 28, 2015

Contributor

Ah doh! That makes sense.

utils.load_extension('widgets/notebook/js/extension').catch(function () {
console.warn('ipywidgets package not installed. Widgets are not available.');
});
// END HARDCODED WIDGETS HACK

Expand Down

0 comments on commit ff191ae

Please sign in to comment.