Refactors all-day event conversion to timed events

Streamlines the conversion of all-day events to timed events during drag and drop operations. This change improves the event rendering process by ensuring proper handling of element replacement and position updates.

Removes redundant code and simplifies the logic for updating the dragged clone.
This commit is contained in:
Janus C. H. Knudsen 2025-10-11 01:30:41 +02:00
parent 0a3d274164
commit 9b073a15b7
3 changed files with 40 additions and 63 deletions

View file

@ -153,7 +153,7 @@ export class EventRenderingService {
this.eventBus.on('drag:move', (event: Event) => {
let dragEvent = (event as CustomEvent<DragMoveEventPayload>).detail;
if (dragEvent.draggedElement.hasAttribute('data-allday')) {
if (dragEvent.draggedClone.hasAttribute('data-allday')) {
return;
}
if (this.strategy.handleDragMove) {
@ -266,9 +266,6 @@ export class EventRenderingService {
calendarEvent: payload.calendarEvent
});
// Remove the old all-day clone from header
payload.draggedClone.remove();
// Delegate to strategy for conversion
if (this.strategy.handleConvertAllDayToTimed) {
this.strategy.handleConvertAllDayToTimed(payload);