Adds dynamic CSS grid column management

Updates ConfigManager to dynamically set CSS grid columns based on work week settings

Ensures the grid layout accurately reflects the number of visible days in the calendar view
Automatically updates grid columns when work week configuration changes

Improves responsive design and layout flexibility
This commit is contained in:
Janus C. H. Knudsen 2025-11-03 22:52:48 +01:00
parent 989c9bd69d
commit d3f4667b61
3 changed files with 18 additions and 3 deletions

View file

@ -115,10 +115,8 @@ export class CalendarManager {
private setupEventListeners(): void {
// Listen for workweek changes only
this.eventBus.on(CoreEvents.WORKWEEK_CHANGED, (event: Event) => {
const customEvent = event as CustomEvent;
// this.handleWorkweekChange();
this.handleWorkweekChange();
});
}

View file

@ -1,5 +1,6 @@
import { CalendarView, IEventBus } from '../types/CalendarTypes';
import { Configuration } from '../configurations/CalendarConfig';
import { ConfigManager } from '../configurations/ConfigManager';
import { CoreEvents } from '../constants/CoreEvents';
@ -95,6 +96,9 @@ export class ViewManager {
this.config.setWorkWeek(workweekId);
// Update CSS grid columns to match new week days count
ConfigManager.updateGridColumns(this.config.dateViewSettings.weekDays);
this.updateAllButtons();
const settings = this.config.getWorkWeekSettings();