Creates all-day container in header renderer

Ensures all-day container is created as part of the standard header structure, rather than on-demand.

Removes the request listener and logic for ensuring all-day container existence.
This commit is contained in:
Janus C. H. Knudsen 2025-09-25 20:39:48 +02:00
parent 4daf1f6975
commit 274753936e
2 changed files with 4 additions and 37 deletions

View file

@ -24,9 +24,6 @@ export class HeaderManager {
// Listen for navigation events to update header
this.setupNavigationListener();
// Listen for requests to ensure all-day container
this.setupContainerRequestListener();
}
/**
@ -60,9 +57,6 @@ export class HeaderManager {
});
if (targetDate) {
// Ensure all-day container exists
this.ensureAllDayContainer();
const calendarType = calendarConfig.getCalendarMode();
const headerRenderer = CalendarTypeFactory.getHeaderRenderer(calendarType);
@ -94,27 +88,6 @@ export class HeaderManager {
console.log('✅ HeaderManager: Drag event listeners attached');
}
/**
* Ensure all-day container exists in header - creates directly
*/
private ensureAllDayContainer(): HTMLElement | null {
const calendarHeader = this.getCalendarHeader();
if (!calendarHeader) return null;
let allDayContainer = calendarHeader.querySelector('swp-allday-container') as HTMLElement;
if (!allDayContainer) {
console.log('📍 HeaderManager: Creating all-day container directly...');
allDayContainer = document.createElement('swp-allday-container');
calendarHeader.appendChild(allDayContainer);
console.log('✅ HeaderManager: All-day container created');
}
return allDayContainer;
}
/**
* Setup navigation event listener
*/
@ -138,16 +111,6 @@ export class HeaderManager {
}
/**
* Setup listener for all-day container creation requests
*/
private setupContainerRequestListener(): void {
eventBus.on('header:ensure-allday-container', () => {
console.log('📍 HeaderManager: Received request to ensure all-day container');
this.ensureAllDayContainer();
});
}
/**
* Update header content for navigation
*/