@@ -441,16 +441,16 @@ function playground_text(playground, hidden = true) {
441441} ) ( ) ;
442442
443443( function sidebar ( ) {
444- var html = document . querySelector ( "html " ) ;
444+ var body = document . querySelector ( "body " ) ;
445445 var sidebar = document . getElementById ( "sidebar" ) ;
446446 var sidebarLinks = document . querySelectorAll ( '#sidebar a' ) ;
447447 var sidebarToggleButton = document . getElementById ( "sidebar-toggle" ) ;
448448 var sidebarResizeHandle = document . getElementById ( "sidebar-resize-handle" ) ;
449449 var firstContact = null ;
450450
451451 function showSidebar ( ) {
452- html . classList . remove ( 'sidebar-hidden' )
453- html . classList . add ( 'sidebar-visible' ) ;
452+ body . classList . remove ( 'sidebar-hidden' )
453+ body . classList . add ( 'sidebar-visible' ) ;
454454 Array . from ( sidebarLinks ) . forEach ( function ( link ) {
455455 link . setAttribute ( 'tabIndex' , 0 ) ;
456456 } ) ;
@@ -471,8 +471,8 @@ function playground_text(playground, hidden = true) {
471471 } ) ;
472472
473473 function hideSidebar ( ) {
474- html . classList . remove ( 'sidebar-visible' )
475- html . classList . add ( 'sidebar-hidden' ) ;
474+ body . classList . remove ( 'sidebar-visible' )
475+ body . classList . add ( 'sidebar-hidden' ) ;
476476 Array . from ( sidebarLinks ) . forEach ( function ( link ) {
477477 link . setAttribute ( 'tabIndex' , - 1 ) ;
478478 } ) ;
@@ -483,14 +483,14 @@ function playground_text(playground, hidden = true) {
483483
484484 // Toggle sidebar
485485 sidebarToggleButton . addEventListener ( 'click' , function sidebarToggle ( ) {
486- if ( html . classList . contains ( "sidebar-hidden" ) ) {
486+ if ( body . classList . contains ( "sidebar-hidden" ) ) {
487487 var current_width = parseInt (
488488 document . documentElement . style . getPropertyValue ( '--sidebar-width' ) , 10 ) ;
489489 if ( current_width < 150 ) {
490490 document . documentElement . style . setProperty ( '--sidebar-width' , '150px' ) ;
491491 }
492492 showSidebar ( ) ;
493- } else if ( html . classList . contains ( "sidebar-visible" ) ) {
493+ } else if ( body . classList . contains ( "sidebar-visible" ) ) {
494494 hideSidebar ( ) ;
495495 } else {
496496 if ( getComputedStyle ( sidebar ) [ 'transform' ] === 'none' ) {
@@ -506,14 +506,14 @@ function playground_text(playground, hidden = true) {
506506 function initResize ( e ) {
507507 window . addEventListener ( 'mousemove' , resize , false ) ;
508508 window . addEventListener ( 'mouseup' , stopResize , false ) ;
509- html . classList . add ( 'sidebar-resizing' ) ;
509+ body . classList . add ( 'sidebar-resizing' ) ;
510510 }
511511 function resize ( e ) {
512512 var pos = ( e . clientX - sidebar . offsetLeft ) ;
513513 if ( pos < 20 ) {
514514 hideSidebar ( ) ;
515515 } else {
516- if ( html . classList . contains ( "sidebar-hidden" ) ) {
516+ if ( body . classList . contains ( "sidebar-hidden" ) ) {
517517 showSidebar ( ) ;
518518 }
519519 pos = Math . min ( pos , window . innerWidth - 100 ) ;
@@ -522,7 +522,7 @@ function playground_text(playground, hidden = true) {
522522 }
523523 //on mouseup remove windows functions mousemove & mouseup
524524 function stopResize ( e ) {
525- html . classList . remove ( 'sidebar-resizing' ) ;
525+ body . classList . remove ( 'sidebar-resizing' ) ;
526526 window . removeEventListener ( 'mousemove' , resize , false ) ;
527527 window . removeEventListener ( 'mouseup' , stopResize , false ) ;
528528 }
0 commit comments