mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
user docs: Highlight currently selected user docs article.
Fixes #7053.
This commit is contained in:
parent
1dcd311ce8
commit
fa92a35f17
@ -17,10 +17,24 @@ function registerCodeSection($codeSection) {
|
||||
$li.eq(0).click();
|
||||
}
|
||||
|
||||
function highlight_current_article() {
|
||||
$('.help .sidebar a').removeClass('highlighted');
|
||||
var path = window.location.href.match(/\/(help|api)\/.+/);
|
||||
|
||||
if (!path) {
|
||||
return;
|
||||
}
|
||||
|
||||
var article = $('.help .sidebar a[href="' + path[0] + '"]');
|
||||
article.addClass('highlighted');
|
||||
}
|
||||
|
||||
function render_code_sections() {
|
||||
$(".code-section").each(function () {
|
||||
registerCodeSection($(this));
|
||||
});
|
||||
|
||||
highlight_current_article();
|
||||
}
|
||||
|
||||
(function () {
|
||||
@ -53,7 +67,6 @@ function render_code_sections() {
|
||||
var path = $(this).attr("href");
|
||||
var container = $(".markdown")[0];
|
||||
|
||||
|
||||
if (loading.name === path) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -205,6 +205,15 @@ body {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.help .sidebar li a.highlighted {
|
||||
background-color: hsl(152, 40%, 42%);
|
||||
|
||||
/* Extend highlight to entire width of sidebar, not just link area */
|
||||
width: calc(100% + 20px);
|
||||
margin-left: -40px;
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
.app.help .hamburger {
|
||||
display: none;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user