From 34775ace901c15171ddb8960697d4e3d675268ac Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 12 Nov 2023 13:27:27 +0100 Subject: [PATCH 1/2] refactor(main.ts): refactor selectBoatChange and initNewChoice functions --- frontend/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/main.ts b/frontend/main.ts index a351893..1bc80ed 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -138,6 +138,9 @@ function selectBoatChange() { const formattedDateTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}T${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`; inputElement.value = formattedDateTime; + + document.getElementById("distance_in_km").value = ""; + document.getElementById("destination").dispatchEvent(new Event('input')); },false); choiceObjects[boatSelect.id] = boatChoice; @@ -376,6 +379,7 @@ function initNewChoice(select: HTMLInputElement) { },false); choiceObjects[select.id] = choice; + document.getElementById("distance_in_km").value = ""; } From 77c888cf13b2451d764174ab37f90c2fc87a9399 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 12 Nov 2023 13:33:39 +0100 Subject: [PATCH 2/2] fix ci --- frontend/main.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 1bc80ed..1978699 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -138,9 +138,12 @@ function selectBoatChange() { const formattedDateTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}T${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`; inputElement.value = formattedDateTime; - - document.getElementById("distance_in_km").value = ""; - document.getElementById("destination").dispatchEvent(new Event('input')); + + const distinput = document.querySelector('#distance_in_km'); + distinput.value = ""; + + const destinput= document.querySelector('#destination'); + destinput.dispatchEvent(new Event('input')); },false); choiceObjects[boatSelect.id] = boatChoice; @@ -379,7 +382,6 @@ function initNewChoice(select: HTMLInputElement) { },false); choiceObjects[select.id] = choice; - document.getElementById("distance_in_km").value = ""; }