Improves header animation performance

Simplifies header animation logic by leveraging CSS Grid for height transitions.

This change removes the direct height animation of the calendar header and relies on CSS Grid's auto row feature to manage the header expansion.
It also removes the manual spacer height calculations in Typescript, and relies on CSS variables to control this.
This results in a smoother and more efficient animation, especially when all-day events are present.
This commit is contained in:
Janus Knudsen 2025-09-01 20:13:15 +02:00
parent ae42de1f3b
commit 58d6ad2ed2
3 changed files with 2 additions and 42 deletions

View file

@ -87,24 +87,4 @@ export class GridStyleManager {
}
}
/**
* Update spacer heights based on all-day events
*/
public updateSpacerHeights(allDayEventCount: number = 1): void {
const eventHeight = 26; // Height per all-day event in pixels
const padding = 0; // Top/bottom padding
const allDayHeight = allDayEventCount > 0 ? (allDayEventCount * eventHeight) + padding : 0;
// Set CSS variable for dynamic spacer height
document.documentElement.style.setProperty('--all-day-row-height', `${allDayHeight}px`);
}
/**
* Get current column count
*/
public getColumnCount(resourceData: ResourceCalendarData | null = null): number {
const calendarType = this.config.getCalendarMode();
return this.calculateColumnCount(calendarType, resourceData);
}
}