Skip to content

Commit f31dc88

Browse files
committed
[runtools] fix merge-mangled config loading
1 parent 8f2c1d2 commit f31dc88

File tree

1 file changed

+2
-19
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/runtools

1 file changed

+2
-19
lines changed

src/jupyter_contrib_nbextensions/nbextensions/runtools/main.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ define([
1111
], function(Jupyter, $, require, events, configmod, utils, codecell) {
1212
"use strict";
1313

14-
var base_url = utils.get_body_data("baseUrl");
15-
var config = new configmod.ConfigSection('notebook', {
16-
base_url: base_url
17-
});
1814
var run_list = []; /* list of cells to be run */
1915

2016
// define default config parameter values
@@ -33,15 +29,6 @@ define([
3329
run_color: '#f30a2d'
3430
};
3531

36-
// updates default params with any specified in the provided config data
37-
var update_params = function(config_data) {
38-
for (var key in params) {
39-
if (config_data.hasOwnProperty(key)) {
40-
params[key] = config_data[key];
41-
}
42-
}
43-
};
44-
4532
/**
4633
* Add event if user clicks on codemirror gutter
4734
*
@@ -70,9 +57,7 @@ define([
7057
* Initialize toolbar and gutter after config was loaded
7158
*/
7259
function initialize() {
73-
if (Jupyter.notebook.config.data.hasOwnProperty('runtools')) {
74-
update_params(Jupyter.notebook.config.data.runtools)
75-
}
60+
$.extend(true, params, Jupyter.notebook.config.data.runtools);
7661

7762
add_gutter_events();
7863

@@ -773,11 +758,9 @@ define([
773758
events.one('notebook_loaded.Notebook', initGutter);
774759
}
775760
});
776-
config.load()
761+
Jupyter.notebook.config.loaded.then(initialize);
777762
};
778763

779-
Jupyter.notebook.config.loaded.then(initialize);
780-
781764
return {
782765
load_jupyter_extension: load_extension,
783766
load_ipython_extension: load_extension

0 commit comments

Comments
 (0)