don't use default distance of 11; don't overwrite distance if already entered #473

Merged
philipp merged 1 commits from logbook-entry-improvement into main 2024-04-30 21:31:34 +02:00
Showing only changes of commit 0b350d344d - Show all commits

View File

@ -189,11 +189,6 @@ function selectBoatChange() {
inputElement.value = formattedDateTime; inputElement.value = formattedDateTime;
const distinput = <HTMLInputElement>(
document.querySelector("#distance_in_km")
);
distinput.value = "";
const destinput = <HTMLInputElement>( const destinput = <HTMLInputElement>(
document.querySelector("#destination") document.querySelector("#destination")
); );
@ -759,9 +754,11 @@ function addRelationMagic(bodyElement: HTMLElement) {
}, },
); );
if (option && option.value !== ""){
// Get distance // Get distance
const distance = option.getAttribute("distance"); const distance = option.getAttribute("distance");
if (distance) relatedField.value = distance; if (distance && relatedField.value === "") relatedField.value = distance;
}
} }
}); });
} }