Optimizes animation speed and event flow
Reduces the duration of a UI height animation for a snappier feel. Disables a specific `header:ready` event emission during navigation rendering.
This commit is contained in:
parent
6498b0ba8e
commit
ffa0bcafc3
3 changed files with 38 additions and 2 deletions
|
|
@ -270,6 +270,29 @@ export class NavigationManager {
|
|||
newGrid.style.position = 'relative';
|
||||
newGrid.removeAttribute('data-prerendered');
|
||||
|
||||
// Reset all-day height and remove hardcoded header height after slide animation
|
||||
const root = document.documentElement;
|
||||
root.style.setProperty('--all-day-row-height', '0px');
|
||||
|
||||
const header = newGrid.querySelector('swp-calendar-header') as HTMLElement;
|
||||
if (header) {
|
||||
// Remove the hardcoded 0px height
|
||||
header.style.height = '';
|
||||
header.style.height
|
||||
// NOW emit header:ready for this specific container
|
||||
const weekEnd = DateCalculator.addDays(targetWeek, 6);
|
||||
this.eventBus.emit('header:ready', {
|
||||
headerElement: header,
|
||||
startDate: targetWeek,
|
||||
endDate: weekEnd,
|
||||
isNavigation: true
|
||||
});
|
||||
|
||||
console.log('🎯 NavigationManager: Animation complete, emitted header:ready', {
|
||||
weekStart: targetWeek.toISOString()
|
||||
});
|
||||
}
|
||||
|
||||
// Clear cache since DOM structure changed
|
||||
this.clearCache();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue