From 06cf175b084c5c12e79a64375a5d6695bbdd8322 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 7 Dec 2017 19:27:54 +0000 Subject: [PATCH] Prevented page navigation highlighting erroring This was when no page nav was on the page --- resources/assets/js/pages/page-show.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/pages/page-show.js b/resources/assets/js/pages/page-show.js index 8c2f0e300..6af5af57d 100644 --- a/resources/assets/js/pages/page-show.js +++ b/resources/assets/js/pages/page-show.js @@ -170,7 +170,7 @@ let setupPageShow = window.setupPageShow = function (pageId) { // fetch all the headings. let headings = document.querySelector('.page-content').querySelectorAll('h1, h2, h3, h4, h5, h6'); // if headings are present, add observers. - if (headings.length > 0) { + if (headings.length > 0 && pageNav !== null) { addNavObserver(headings); }