Improves all-day event drag and drop

Enhances the drag and drop experience for all-day events by expanding the header to display the all-day row when dragging an event over it.

Introduces constants for all-day event layout.
This commit is contained in:
Janus Knudsen 2025-08-24 23:31:11 +02:00
parent 457e222262
commit eb08a28495
6 changed files with 118 additions and 10 deletions

View file

@ -3,6 +3,7 @@ import { ResourceCalendarData } from '../types/CalendarTypes';
import { CalendarTypeFactory } from '../factories/CalendarTypeFactory';
import { HeaderRenderContext } from './HeaderRenderer';
import { ColumnRenderContext } from './ColumnRenderer';
import { eventBus } from '../core/EventBus';
/**
* GridRenderer - Handles DOM rendering for the calendar grid
* Separated from GridManager to follow Single Responsibility Principle
@ -133,6 +134,14 @@ export class GridRenderer {
};
headerRenderer.render(calendarHeader, context);
// Add mouseover listeners on day headers for drag detection
const dayHeaders = calendarHeader.querySelectorAll('swp-day-header');
dayHeaders.forEach(dayHeader => {
dayHeader.addEventListener('mouseover', () => {
eventBus.emit('header:mouseover', { dayHeader, headerRenderer });
});
});
}
/**