From cd7d744d9bdf4b56734b3ff186191b64aea26a35 Mon Sep 17 00:00:00 2001 From: sptaule Date: Tue, 1 Feb 2022 10:44:25 +0100 Subject: Fix global ToC js error in console --- templates/partials/doc/global_toc_script.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/partials/doc/global_toc_script.html b/templates/partials/doc/global_toc_script.html index 42abcda..8b23fec 100644 --- a/templates/partials/doc/global_toc_script.html +++ b/templates/partials/doc/global_toc_script.html @@ -16,8 +16,10 @@ document.addEventListener("DOMContentLoaded", function() { if (parentMenu.classList.contains('subMenu')) { // child parentMenu.previousElementSibling.previousElementSibling.checked = false; } else { // parent - activeDocPage.nextElementSibling.checked = false; - } + if (activeDocPage.nextElementSibling) { + activeDocPage.nextElementSibling.checked = false; + } + } }); window.addEventListener('scroll', function() { -- cgit v1.2.3