look for in-page links anywhere in page
authorDan Allen <dan@opendevise.com>
Sun, 4 Feb 2018 01:01:07 +0000 (18:01 -0700)
committerSarah White <sarah@opendevise.com>
Sun, 4 Feb 2018 22:25:04 +0000 (22:25 +0000)
- fixes the scroll offset when an in-page link in the site navigation is clicked

preview-site-src/ui-model.yml
src/js/02-fragment-jumper.js

index 22bdc87..4273bca 100644 (file)
@@ -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: '#'
index f680f75..e324227 100644 (file)
@@ -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))