File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments