WIP
This commit is contained in:
parent
fb40279009
commit
3b75e1cafc
1 changed files with 37 additions and 3 deletions
|
|
@ -221,15 +221,34 @@ export class SwpAllDayEventElement extends BaseEventElement {
|
|||
const existingEvents = document.querySelectorAll('swp-allday-event');
|
||||
const occupiedRows = new Set<number>();
|
||||
|
||||
console.log('🔍 SwpAllDayEventElement: Checking grid row for new event', {
|
||||
targetDate,
|
||||
finalStartColumn,
|
||||
finalEndColumn,
|
||||
existingEventsCount: existingEvents.length
|
||||
});
|
||||
|
||||
existingEvents.forEach(existingEvent => {
|
||||
const style = getComputedStyle(existingEvent);
|
||||
const eventStartCol = parseInt(style.gridColumnStart);
|
||||
const eventEndCol = parseInt(style.gridColumnEnd);
|
||||
|
||||
// Check if this existing event overlaps with our column span
|
||||
if (this.columnsOverlap(eventStartCol, eventEndCol, finalStartColumn, finalEndColumn)) {
|
||||
const eventRow = parseInt(style.gridRowStart) || 1;
|
||||
const eventId = (existingEvent as HTMLElement).dataset.eventId;
|
||||
|
||||
console.log('📊 SwpAllDayEventElement: Checking existing event', {
|
||||
eventId,
|
||||
eventStartCol,
|
||||
eventEndCol,
|
||||
eventRow,
|
||||
newEventColumn: finalStartColumn
|
||||
});
|
||||
|
||||
// FIXED: Only check events in the same column (not overlap detection)
|
||||
if (eventStartCol === finalStartColumn) {
|
||||
console.log('✅ SwpAllDayEventElement: Same column - adding occupied row', eventRow);
|
||||
occupiedRows.add(eventRow);
|
||||
} else {
|
||||
console.log('⏭️ SwpAllDayEventElement: Different column - skipping');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -239,10 +258,25 @@ export class SwpAllDayEventElement extends BaseEventElement {
|
|||
targetRow++;
|
||||
}
|
||||
|
||||
console.log('🎯 SwpAllDayEventElement: Final row assignment', {
|
||||
targetDate,
|
||||
finalStartColumn,
|
||||
occupiedRows: Array.from(occupiedRows).sort(),
|
||||
assignedRow: targetRow
|
||||
});
|
||||
|
||||
// Create element with calculated column span
|
||||
const element = new SwpAllDayEventElement(event, finalStartColumn);
|
||||
element.setGridRow(targetRow);
|
||||
element.setColumnSpan(finalStartColumn, finalEndColumn);
|
||||
|
||||
console.log('✅ SwpAllDayEventElement: Created all-day event', {
|
||||
eventId: event.id,
|
||||
title: event.title,
|
||||
column: finalStartColumn,
|
||||
row: targetRow
|
||||
});
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue