Skip to content

Commit 7a00d1a

Browse files
dandimeodandimeo
and
dandimeo
authored
fix: fix anchor links scroll behaviour, put the scroll function call in loadPage() and delete debug warnf page (#251)
Co-authored-by: dandimeo <daniele@arangodb.com>
1 parent ac4d358 commit 7a00d1a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

site/themes/arangodb-docs-theme/layouts/_default/single.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"page" .Page
33
) }}
44

5-
{{ warnf "PAGE %s" . }}
6-
75

86
<!DOCTYPE html>
97
<html lang="{{ .Page.Language | default "en" }}">

site/themes/arangodb-docs-theme/static/js/theme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ function loadPage(target) {
164164
url: href,
165165
success: function(newDoc) {
166166
replaceArticle(href, newDoc)
167+
scrollToFragment();
167168
initArticle(href);
168169
return true;
169170
},
@@ -220,7 +221,7 @@ $(window).on('hashchange', function (e) {
220221
_hsq.push(['setPath', window.location.href]);
221222
_hsq.push(['trackPageView']);
222223

223-
scrollToOpenApiFragment()
224+
scrollToFragment()
224225
});
225226

226227

@@ -434,7 +435,7 @@ function hideEmptyOpenapiDiv() {
434435
}
435436
}
436437

437-
function scrollToOpenApiFragment() {
438+
function scrollToFragment() {
438439
fragment = location.hash.replace("#", "")
439440
if (fragment) {
440441
var element = document.getElementById(fragment);
@@ -561,5 +562,4 @@ window.onload = () => {
561562

562563
$('#show-page-loading').hide();
563564
$('#page-wrapper').css("opacity", "1")
564-
scrollToOpenApiFragment();
565565
}

0 commit comments

Comments
 (0)