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 existingEvents = document.querySelectorAll('swp-allday-event');
|
||||||
const occupiedRows = new Set<number>();
|
const occupiedRows = new Set<number>();
|
||||||
|
|
||||||
|
console.log('🔍 SwpAllDayEventElement: Checking grid row for new event', {
|
||||||
|
targetDate,
|
||||||
|
finalStartColumn,
|
||||||
|
finalEndColumn,
|
||||||
|
existingEventsCount: existingEvents.length
|
||||||
|
});
|
||||||
|
|
||||||
existingEvents.forEach(existingEvent => {
|
existingEvents.forEach(existingEvent => {
|
||||||
const style = getComputedStyle(existingEvent);
|
const style = getComputedStyle(existingEvent);
|
||||||
const eventStartCol = parseInt(style.gridColumnStart);
|
const eventStartCol = parseInt(style.gridColumnStart);
|
||||||
const eventEndCol = parseInt(style.gridColumnEnd);
|
const eventEndCol = parseInt(style.gridColumnEnd);
|
||||||
|
const eventRow = parseInt(style.gridRowStart) || 1;
|
||||||
|
const eventId = (existingEvent as HTMLElement).dataset.eventId;
|
||||||
|
|
||||||
// Check if this existing event overlaps with our column span
|
console.log('📊 SwpAllDayEventElement: Checking existing event', {
|
||||||
if (this.columnsOverlap(eventStartCol, eventEndCol, finalStartColumn, finalEndColumn)) {
|
eventId,
|
||||||
const eventRow = parseInt(style.gridRowStart) || 1;
|
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);
|
occupiedRows.add(eventRow);
|
||||||
|
} else {
|
||||||
|
console.log('⏭️ SwpAllDayEventElement: Different column - skipping');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -239,10 +258,25 @@ export class SwpAllDayEventElement extends BaseEventElement {
|
||||||
targetRow++;
|
targetRow++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('🎯 SwpAllDayEventElement: Final row assignment', {
|
||||||
|
targetDate,
|
||||||
|
finalStartColumn,
|
||||||
|
occupiedRows: Array.from(occupiedRows).sort(),
|
||||||
|
assignedRow: targetRow
|
||||||
|
});
|
||||||
|
|
||||||
// Create element with calculated column span
|
// Create element with calculated column span
|
||||||
const element = new SwpAllDayEventElement(event, finalStartColumn);
|
const element = new SwpAllDayEventElement(event, finalStartColumn);
|
||||||
element.setGridRow(targetRow);
|
element.setGridRow(targetRow);
|
||||||
element.setColumnSpan(finalStartColumn, finalEndColumn);
|
element.setColumnSpan(finalStartColumn, finalEndColumn);
|
||||||
|
|
||||||
|
console.log('✅ SwpAllDayEventElement: Created all-day event', {
|
||||||
|
eventId: event.id,
|
||||||
|
title: event.title,
|
||||||
|
column: finalStartColumn,
|
||||||
|
row: targetRow
|
||||||
|
});
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue