Skip to content

Commit 5fbff64

Browse files
committed
removed updating start times on delete
1 parent f6badf2 commit 5fbff64

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

static/js/event-management.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -297,23 +297,9 @@ document.addEventListener("DOMContentLoaded", () => {
297297
}
298298

299299
timeFields.addEventListener("click", (event) => {
300-
// handle click events for removing time entries
300+
// remove a time entry
301301
if (!event.target.classList.contains("remove-time-entry")) return;
302-
303-
const entry = event.target.closest(".time-entry");
304-
const precedingEntry = entry.previousElementSibling;
305-
306-
entry.remove();
307-
308-
if (precedingEntry && precedingEntry.classList.contains("time-entry")) {
309-
// if there is a preceding entry update all subsequent start times
310-
const startTimeInput = precedingEntry.querySelector("input[name='start_time[]']");
311-
if (startTimeInput) updateFutureStartTimes(startTimeInput);
312-
} else if (document.querySelector(".time-entry")) {
313-
// if no preceding entry, update the first entry's start time
314-
const firstEntry = document.querySelector(".time-entry").querySelector("input[name='start_time[]']");
315-
if (firstEntry) updateFutureStartTimes(firstEntry);
316-
}
302+
const entry = event.target.closest(".time-entry").remove();
317303
});
318304

319305
function initialiseTimes() {

0 commit comments

Comments
 (0)