wwip
This commit is contained in:
parent
a9d6d14c93
commit
420036d939
4 changed files with 17 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ import { AllDayEventRenderer } from '../renderers/AllDayEventRenderer';
|
|||
import { AllDayLayoutEngine, EventLayout } from '../utils/AllDayLayoutEngine';
|
||||
import { ColumnBounds, ColumnDetectionUtils } from '../utils/ColumnDetectionUtils';
|
||||
import { CalendarEvent } from '../types/CalendarTypes';
|
||||
import { SwpAllDayEventElement } from '../elements/SwpEventElement';
|
||||
import {
|
||||
DragMouseEnterHeaderEventPayload,
|
||||
DragStartEventPayload,
|
||||
|
|
@ -312,20 +313,19 @@ export class AllDayManager {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle conversion of timed event to all-day event - SIMPLIFIED
|
||||
* During drag: Place in row 1 only, calculate column from targetDate
|
||||
*/
|
||||
private handleConvertToAllDay(payload: DragMouseEnterHeaderEventPayload): void {
|
||||
|
||||
let allDayContainer = this.getAllDayContainer();
|
||||
if (!allDayContainer) return;
|
||||
|
||||
payload.draggedClone.removeAttribute('style');
|
||||
payload.draggedClone.style.gridRow = '1';
|
||||
payload.draggedClone.style.gridColumn = payload.targetColumn.index.toString();
|
||||
payload.draggedClone.dataset.allday = 'true';
|
||||
const allDayElement = SwpAllDayEventElement.fromCalendarEvent(payload.calendarEvent);
|
||||
|
||||
allDayContainer?.appendChild(payload.draggedClone);
|
||||
// Apply grid positioning
|
||||
allDayElement.style.gridRow = '1';
|
||||
allDayElement.style.gridColumn = payload.targetColumn.index.toString();
|
||||
|
||||
payload.draggedClone.remove();
|
||||
allDayContainer.appendChild(allDayElement);
|
||||
|
||||
ColumnDetectionUtils.updateColumnBoundsCache();
|
||||
|
||||
|
|
|
|||
|
|
@ -495,11 +495,15 @@ export class DragDropManager {
|
|||
if (targetColumn) {
|
||||
console.log('🎯 DragDropManager: Emitting drag:mouseenter-header', { targetDate: targetColumn });
|
||||
|
||||
// Extract CalendarEvent from the dragged clone
|
||||
const calendarEvent = SwpEventElement.extractCalendarEventFromElement(this.draggedClone!!);
|
||||
|
||||
const dragMouseEnterPayload: DragMouseEnterHeaderEventPayload = {
|
||||
targetColumn: targetColumn,
|
||||
mousePosition: { x: event.clientX, y: event.clientY },
|
||||
originalElement: this.draggedElement,
|
||||
draggedClone: this.draggedClone!!
|
||||
draggedClone: this.draggedClone!!,
|
||||
calendarEvent: calendarEvent
|
||||
};
|
||||
this.eventBus.emit('drag:mouseenter-header', dragMouseEnterPayload);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue