From 05fa5558e3d3b246f333d0ba0d4d49e013a010d8 Mon Sep 17 00:00:00 2001 From: knighthawk4227 Date: Wed, 21 May 2025 17:02:35 -0700 Subject: [PATCH] open modal of plan after pressing create new plan --- src/public/scripts/planModals.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/public/scripts/planModals.js b/src/public/scripts/planModals.js index 07a8dbe..4eca1f2 100644 --- a/src/public/scripts/planModals.js +++ b/src/public/scripts/planModals.js @@ -6,6 +6,13 @@ document.addEventListener('DOMContentLoaded', () => { const newPlanError = document.getElementById('newPlanError'); const resetNewPlanFormBtn = document.getElementById('resetNewPlanFormBtn'); + let url = new URLSearchParams(window.location.search); + let modalValue = url.get('openModal'); + + if (modalValue === 'true') { + newPlanDialog.showModal(); + } + openModalBtn.addEventListener('click', () => { newPlanDialog.showModal(); // Error reset is now handled by 'close' event, but good to clear on open too