Skip to content
Snippets Groups Projects
Unverified Commit 13a99f88 authored by Sietze van Buuren's avatar Sietze van Buuren Committed by Ritesh Raj Sarraf
Browse files

Fix sidebar menu page focus

parent e9b8789c
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,20 @@ function toggleSidebar(item) {
</script>
<script>
if ($('#sidebar-focus').length != 0) {
$('#site-sidebar').scrollTop($('#sidebar-focus').position().top - 100);
}
</script>
window.addEventListener("load", function(){
var sidebarFocus = $('#sidebar-focus');
if (sidebarFocus.length != 0) {
var sidebarPageFocus = $('#sidebar-page-focus');
var siteSidebar = $('#site-sidebar');
if (sidebarPageFocus.length != 0) {
var scrollOffset = sidebarPageFocus.position().top + 200 -
document.getElementById('site-sidebar').offsetHeight;
if (scrollOffset > 0) {
siteSidebar.scrollTop(scrollOffset);
}
} else {
siteSidebar.scrollTop(sidebarFocus.position().top - 100);
}
}
});
</script>
\ No newline at end of file
......@@ -216,8 +216,10 @@
{{ $currentPage := . }}
{{ range .Pages.ByTitle }}
<li class="sidebar-page {{ if eq $currentPage.RelPermalink .URL }}active{{ end }}">
<a href="{{ .Permalink | relLangURL }}">{{ .Name }}</a>
<li class="sidebar-page">
<a href="{{ .Permalink | relLangURL }}"
{{ if eq $.Page.RelPermalink .RelPermalink }}id="sidebar-page-focus" class="sidebar-page-focus"{{end}}>
{{ .Name }}</a>
</li>
{{ end }}
......
......@@ -878,6 +878,11 @@ div.notices.tip p:first-child:after {
.sidebar-page a {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.sidebar-page-focus {
font-weight: bold !important;
color: #e67d1e !important;
}
/* --- PDF Note --- */
div.pdflink {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment