Skip to content

Commit 640a7d5

Browse files
authored
Merge pull request #1403 from zthxxx/master
fix: fix toc2.js load failed with working in non-live notebook
2 parents bccd908 + 7144c90 commit 640a7d5

File tree

1 file changed

+6
-1
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/toc2

1 file changed

+6
-1
lines changed

src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
*/
5757
var read_config = function () {
5858
var cfg = default_cfg;
59+
60+
if (!liveNotebook) {
61+
return cfg;
62+
}
63+
5964
// config may be specified at system level or at document level.
6065
// first, update defaults with config loaded from server
6166
$.extend(true, cfg, IPython.notebook.config.data.toc2);
@@ -643,7 +648,7 @@
643648
});
644649

645650
// update navigation menu
646-
if (cfg.navigate_menu) {
651+
if (cfg.navigate_menu && liveNotebook) {
647652
var pop_nav = function() { //callback for create_nav_menu
648653
$('#navigate_menu').empty().append($('#toc > .toc-item').clone());
649654
}

0 commit comments

Comments
 (0)