From b4f0a63f43452e93d9dac120fd1559d0e91fd9d6 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 3 Feb 2018 18:01:07 -0700 Subject: [PATCH] look for in-page links anywhere in page - fixes the scroll offset when an in-page link in the site navigation is clicked --- preview-site-src/ui-model.yml | 4 ++-- src/js/02-fragment-jumper.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)) -- 2.11.0