Преглед изворни кода

fix: navbar active link highlighting and scrolling

Fixes edge case caused due to responsive navbar height. More
specifically, a possible race condition between Scrollspy init and
updating its offset.

Fix #1199
George Cushen пре 6 година
родитељ
комит
64cceae099
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      layouts/_default/baseof.html

+ 1 - 2
layouts/_default/baseof.html

@@ -2,8 +2,7 @@
 <html lang="{{ site.LanguageCode | default "en-us" }}">
 
 {{ partial "site_head.html" . }}
-
-<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
+<body id="top" data-spy="scroll" data-offset="70" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
 
   {{ partial "search" . }}