File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/jupyter_contrib_nbextensions/nbextensions/toc2 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 311
311
312
312
var makeUnmakeSidebar = function ( cfg ) {
313
313
var make_sidebar = cfg . sideBar ;
314
- var view_rect = ( liveNotebook ? document . getElementById ( 'site' ) : document . body ) . getBoundingClientRect ( ) ;
315
314
var wrap = $ ( '#toc-wrapper' )
316
315
. toggleClass ( 'sidebar-wrapper' , make_sidebar )
317
316
. toggleClass ( 'float-wrapper' , ! make_sidebar )
318
317
. resizable ( 'option' , 'handles' , make_sidebar ? 'e' : 'all' ) ;
319
318
wrap . children ( '.ui-resizable-se' ) . toggleClass ( 'ui-icon' , ! make_sidebar ) ;
320
319
wrap . children ( '.ui-resizable-e' ) . toggleClass ( 'ui-icon ui-icon-grip-dotted-vertical' , make_sidebar ) ;
321
320
if ( make_sidebar ) {
322
- wrap . css ( { top : view_rect . top , height : '' , left : 0 } ) ;
321
+ var sidebar_top = liveNotebook ? document . getElementById ( 'site' ) . top : 0
322
+ wrap . css ( { top : sidebar_top , height : "" , left : 0 } ) ;
323
323
}
324
324
else {
325
325
wrap . css ( { height : toc_position . height } ) ;
367
367
drag : function ( event , ui ) {
368
368
var make_sidebar = ui . position . left < 20 ; // 20 is snapTolerance
369
369
if ( make_sidebar ) {
370
- ui . position . top = ( liveNotebook ? document . getElementById ( 'site' ) : document . body ) . getBoundingClientRect ( ) . top ;
370
+ ui . position . top = liveNotebook ? document . getElementById ( 'site' ) . top : 0
371
371
ui . position . left = 0 ;
372
372
}
373
373
if ( make_sidebar !== cfg . sideBar ) {
You can’t perform that action at this time.
0 commit comments