From 5a1adad1ba1709c48cd553d3b7e658c89fc6163f Mon Sep 17 00:00:00 2001 From: Theory-of-everything1 <58880827+theory-of-evrth@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:21:45 +0200 Subject: [PATCH] quickfix of js error --- timeliner/resources/js/timelinelistener.js | 5 +++++ timeliner/resources/views/timeline/timeline.blade.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/timeliner/resources/js/timelinelistener.js b/timeliner/resources/js/timelinelistener.js index ebcd273..7dc5ec3 100644 --- a/timeliner/resources/js/timelinelistener.js +++ b/timeliner/resources/js/timelinelistener.js @@ -2,6 +2,11 @@ document.addEventListener('DOMContentLoaded', () => { const nodes = document.querySelectorAll('.node'); const dates = []; + if (nodes.length === 0) { + console.warn("No nodes found."); + return; + } + // Gather all milestone dates for range calculation nodes.forEach(node => { const milestones = node.querySelectorAll('.milestone'); diff --git a/timeliner/resources/views/timeline/timeline.blade.php b/timeliner/resources/views/timeline/timeline.blade.php index 4fa9d64..8197d10 100644 --- a/timeliner/resources/views/timeline/timeline.blade.php +++ b/timeliner/resources/views/timeline/timeline.blade.php @@ -17,7 +17,7 @@ @endauth -
+