parent
e3717ad47b
commit
6a94492238
|
@ -408,7 +408,7 @@ function playpen_text(playpen) {
|
||||||
(function sidebar() {
|
(function sidebar() {
|
||||||
var html = document.querySelector("html");
|
var html = document.querySelector("html");
|
||||||
var sidebar = document.getElementById("sidebar");
|
var sidebar = document.getElementById("sidebar");
|
||||||
var sidebarScrollBox = document.getElementById("sidebar-scrollbox");
|
var sidebarScrollBox = document.querySelector(".sidebar-scrollbox");
|
||||||
var sidebarLinks = document.querySelectorAll('#sidebar a');
|
var sidebarLinks = document.querySelectorAll('#sidebar a');
|
||||||
var sidebarToggleButton = document.getElementById("sidebar-toggle");
|
var sidebarToggleButton = document.getElementById("sidebar-toggle");
|
||||||
var sidebarResizeHandle = document.getElementById("sidebar-resize-handle");
|
var sidebarResizeHandle = document.getElementById("sidebar-resize-handle");
|
||||||
|
@ -505,7 +505,7 @@ function playpen_text(playpen) {
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
|
|
||||||
// Scroll sidebar to current active section
|
// Scroll sidebar to current active section
|
||||||
var activeSection = sidebar.querySelector(".active");
|
var activeSection = document.getElementById("sidebar").querySelector(".active");
|
||||||
if (activeSection) {
|
if (activeSection) {
|
||||||
sidebarScrollBox.scrollTop = activeSection.offsetTop;
|
sidebarScrollBox.scrollTop = activeSection.offsetTop;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue