Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/calendar-app/calendar-app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h3 class="sideNavHeader">Calendar Menu</h3>
</mat-sidenav>

<mat-sidenav-content>
<mat-toolbar>
<mat-toolbar class="calendarToolbar">
<button mat-icon-button (click)="sidemenu.toggle()">
<mat-icon svgIcon="menu"></mat-icon>
</button>
Expand Down
18 changes: 18 additions & 0 deletions src/app/calendar-app/calendar-app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@
padding: 16px;
}
}

@media(min-width: 1025px) {
.calendarToolbar {
position: sticky;
top: 0;
z-index: 10;
}

:host ::ng-deep {
.cal-month-view .cal-header,
.cal-week-view .cal-day-headers {
background-color: #fff;
position: sticky;
top: 64px;
z-index: 9;
}
}
}
7 changes: 7 additions & 0 deletions src/app/calendar-app/calendar-app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ END:VCALENDAR
expect(icon.style.color).toBe('pink');
});

it('should mark the calendar toolbar for sticky positioning', () => {
fixture.detectChanges();

const toolbar = fixture.debugElement.nativeElement.querySelector('mat-toolbar.calendarToolbar');
expect(toolbar).toBeTruthy();
});

it('should display events', () => {
mockData['events'] = simpleEvents;
component.calendarservice.syncCaldav(true);
Expand Down