Skip to content

Commit

Permalink
[toc2] On header/menu/toolbar resize, resize toc2 sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbercher committed Feb 1, 2017
1 parent 4f23e75 commit cb4a65b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,18 @@ var make_link = function(h, num_lbl) {

$("body").append(toc_wrapper);


// On header/menu/toolbar resize, resize the toc itself
// (if displayed as a sidebar)
if (liveNotebook) {
$([Jupyter.events]).on("resize-header.Page", function() {
if (cfg.sideBar) {
$('#toc-wrapper').css('top', liveNotebook ? $('#header').height() : 0)
$('#toc-wrapper').css('height', $('#site').height());
$('#toc').css('height', $('#toc-wrapper').height() - $('#toc-header').height())
}
});
}

// enable dragging and save position on stop moving
$('#toc-wrapper').draggable({

Expand Down

0 comments on commit cb4a65b

Please sign in to comment.