mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 20:15:25 +00:00
fix: in-page anchor scrolling on mobile
This commit is contained in:
1 parent
18ae2268f3
commit
44f9170f07
2 files changed
+7
-1
No files matched your search
@@ -13,8 +13,12 @@
|
||||
|
||||
// Dynamically get responsive navigation bar height for offsetting Scrollspy.
|
||||
function getNavBarHeight() {
|
||||
let $navbar = $('.navbar');
|
||||
let $navbar = $('#navbar-main');
|
||||
let $navbar_collapse_show = $('#navbar-main .navbar-collapse.collapse.show');
|
||||
let navbar_offset = $navbar.innerHeight();
|
||||
if ($navbar_collapse_show.length){
|
||||
navbar_offset -= $navbar_collapse_show.innerHeight();
|
||||
}
|
||||
console.debug('Navbar height: ' + navbar_offset);
|
||||
return navbar_offset;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{ if site.Params.edit_page }}{{/* Make `edit_page` optional in `params.toml` - prevent errors if it's removed. */}}
|
||||
{{ if site.Params.edit_page.repo_url | and (index site.Params.edit_page.editable .Type) | and (ne .Params.editable false) | or .Params.editable }}
|
||||
<p class="edit-page">
|
||||
<a href="{{site.Params.edit_page.repo_url}}/edit/{{site.Params.edit_page.repo_branch | default "master"}}/content/{{.File.Path}}">
|
||||
@@ -5,3 +6,4 @@
|
||||
</a>
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user