diff --git a/frontend/main.ts b/frontend/main.ts index be3479b..678ce29 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -118,16 +118,16 @@ function initSidebar() { function initTripSidebar(triggerElement: HTMLElement) { const sidebarElement = document.querySelector('#sidebar'); - if(sidebarElement && triggerElement.dataset.form && triggerElement.dataset.header) { - let form = document.querySelector(triggerElement.dataset.form); - let formElement = form.cloneNode(true); - let formContainerElement = sidebarElement.querySelector('.body-js'); - if(formContainerElement) { - formContainerElement.innerHTML = ''; - formContainerElement.append(formElement); + if(sidebarElement && triggerElement.dataset.body && triggerElement.dataset.header) { + let body = document.querySelector(triggerElement.dataset.body); + let bodyElement = body.cloneNode(true); + let bodyContainerElement = sidebarElement.querySelector('.body-js'); + if(bodyContainerElement) { + bodyContainerElement.innerHTML = ''; + bodyContainerElement.append(bodyElement); } if(triggerElement.dataset.day) { - let hiddenElement = formElement.querySelector('.day-js'); + let hiddenElement = bodyElement.querySelector('.day-js'); if(hiddenElement) { hiddenElement.value = triggerElement.dataset.day; } diff --git a/templates/index.html.tera b/templates/index.html.tera index bac3b71..e1e6e9d 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -47,7 +47,7 @@ Details @@ -145,7 +145,7 @@ class="text-gray-600">({{ trip.cox_name }})
Details @@ -214,7 +214,7 @@ {% include "includes/plus-icon" %} @@ -227,7 +227,7 @@ {% include "includes/plus-icon" %}