Skip to content

Commit 4151a88

Browse files
committed
[toc2] simplify toggle_toc to fix bug in at-start minimizing
for some reaosn this was needed to prevent size being set to 1px by 1px :shrugs:
1 parent 75f5a6a commit 4151a88

File tree

1 file changed

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

1 file changed

+6
-9
lines changed

src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -689,15 +689,12 @@
689689

690690
var toggle_toc = function(cfg, st) {
691691
// toggle draw (first because of first-click behavior)
692-
$("#toc-wrapper").toggle({
693-
'progress': function() {
694-
setNotebookWidth(cfg, st);
695-
},
696-
'complete': function() {
697-
setMd('toc_window_display', $('#toc-wrapper').css('display') !== 'none');
698-
table_of_contents(cfg, st);
699-
}
700-
});
692+
var wrap = $("#toc-wrapper");
693+
var show = wrap.is(':hidden');
694+
wrap.toggle(show);
695+
setMd('toc_window_display', show);
696+
setNotebookWidth(cfg);
697+
table_of_contents(cfg);
701698
};
702699

703700
var show_settings_dialog = function (cfg, st) {

0 commit comments

Comments
 (0)