From: Dan Allen Date: Sun, 4 Feb 2018 01:01:07 +0000 (-0700) Subject: look for in-page links anywhere in page X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b4f0a63f43452e93d9dac120fd1559d0e91fd9d6;p=working%2Feg-antora.git look for in-page links anywhere in page - fixes the scroll offset when an in-page link in the site navigation is clicked --- diff --git a/preview-site-src/ui-model.yml b/preview-site-src/ui-model.yml index 22bdc87..4273bca 100644 --- a/preview-site-src/ui-model.yml +++ b/preview-site-src/ui-model.yml @@ -79,8 +79,8 @@ page: - title: IDE Integration url: '#' urlType: fragment - - content: Application Tutorial - url: '#' + - content: Liber Recusabo + url: '#liber-recusabo' urlType: fragment - content: Reference url: '#' diff --git a/src/js/02-fragment-jumper.js b/src/js/02-fragment-jumper.js index f680f75..e324227 100644 --- a/src/js/02-fragment-jumper.js +++ b/src/js/02-fragment-jumper.js @@ -28,7 +28,7 @@ window.removeEventListener('load', jumpOnLoad) }) - Array.prototype.slice.call(document.querySelectorAll('.doc a[href^="#"]')).forEach(function (el) { + Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]')).forEach(function (el) { var hash, target if ((hash = el.hash.slice(1)) && (target = document.getElementById(hash))) { el.addEventListener('click', jumpToAnchor.bind(target))