Update sidebar.
It now is an overlay on mobile
This commit is contained in:
@@ -30,23 +30,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
var rail = document.querySelector("aside.sidebar");
|
||||
rail.appendChild(nav);
|
||||
|
||||
var fab = document.createElement("button");
|
||||
fab.type = "button";
|
||||
fab.className = "btn btn-fab fab";
|
||||
fab.title = "Contents";
|
||||
fab.setAttribute("aria-label", "Contents");
|
||||
fab.setAttribute("aria-expanded", "false");
|
||||
fab.textContent = "≡";
|
||||
fab.addEventListener("click", function () {
|
||||
var open = nav.classList.toggle("is-open");
|
||||
fab.setAttribute("aria-expanded", open ? "true" : "false");
|
||||
});
|
||||
nav.addEventListener("click", function (e) {
|
||||
if (e.target.tagName === "A") {
|
||||
nav.classList.remove("is-open");
|
||||
fab.setAttribute("aria-expanded", "false");
|
||||
}
|
||||
});
|
||||
document.body.appendChild(fab);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user