From 87d8a54b91bfe0ddbcb9acd476b2d5bf3fbabe32 Mon Sep 17 00:00:00 2001 From: Gittenburg Date: Tue, 28 Jul 2020 22:48:50 +0200 Subject: [PATCH] help: Stop collapsing sidebar sections. Three reasons: 1. The sliding was disorienting. 2. The collapsing disallowed searching for other pages with Ctrl+F. 3. The collapsing mechanism wasn't accessible (not usable with the keyboard / no ARIA tags). Tweaked by tabbott to center the left sidebar on the selected page. Part of #15948. --- static/js/portico/help.js | 13 ++----------- templates/zerver/documentation_main.html | 2 +- zerver/views/documentation.py | 4 ---- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/static/js/portico/help.js b/static/js/portico/help.js index bbbaa76165..bbe7cefbc7 100644 --- a/static/js/portico/help.js +++ b/static/js/portico/help.js @@ -100,17 +100,6 @@ const update_page = function (html_map, path) { new SimpleBar($(".sidebar")[0]); -$(".sidebar.slide h2").on("click", (e) => { - const $next = $(e.target).next(); - - if ($next.is("ul")) { - // Close other article's headings first - $(".sidebar ul").not($next).hide(); - // Toggle the heading - $next.slideToggle("fast", "swing"); - } -}); - $(".sidebar a").on("click", function (e) { const path = $(this).attr("href"); const path_dir = path.split("/")[1]; @@ -173,3 +162,5 @@ window.addEventListener("popstate", () => { }); $("body").addClass("noscroll"); + +$(".highlighted")[0].scrollIntoView({block: "center"}); diff --git a/templates/zerver/documentation_main.html b/templates/zerver/documentation_main.html index fcf1f2e056..3efab133da 100644 --- a/templates/zerver/documentation_main.html +++ b/templates/zerver/documentation_main.html @@ -5,7 +5,7 @@ {% block portico_content %}
-