]> BookStack Code Mirror - bookstack/commitdiff
Prevented page navigation highlighting erroring
authorDan Brown <redacted>
Thu, 7 Dec 2017 19:27:54 +0000 (19:27 +0000)
committerDan Brown <redacted>
Thu, 7 Dec 2017 19:27:54 +0000 (19:27 +0000)
This was when no page nav was on the page

resources/assets/js/pages/page-show.js

index 8c2f0e300a7723c6349de0239a9fc8e8af600cba..6af5af57d8f979e0017f0482a41ccf141b3fe1a4 100644 (file)
@@ -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);
       }
 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.