From 8e61312fa9764039261ef3a9ccce124a13d642ea Mon Sep 17 00:00:00 2001 From: Josh Barnes Date: Tue, 19 Dec 2017 13:39:21 +0000 Subject: [PATCH] [toc2] ensure default config values are present in non-live notebooks --- .../nbextensions/toc2/toc2.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js b/src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js index eee892492..0858cd085 100644 --- a/src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js +++ b/src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js @@ -529,6 +529,12 @@ return } + // In a live notebook, read_config will have been called already, but + // in non-live notebooks, ensure that all config values are defined. + if (!liveNotebook) { + cfg = $.extend(true, {}, default_cfg, cfg); + } + var toc_wrapper = $("#toc-wrapper"); if (toc_wrapper.length === 0) { // toc window doesn't exist at all create_toc_div(cfg, st); // create it @@ -537,9 +543,6 @@ var ul = $('