mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 07:30:12 +01:00
Fixing footer, header and calendar WCAG Issues
This commit is contained in:
parent
012d9ed210
commit
16c2016fe9
1 changed files with 30 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
import {
|
||||
AfterViewInit,
|
||||
Directive,
|
||||
ElementRef,
|
||||
Renderer2,
|
||||
} from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
selector: '[ngxCalendarAriaLabel]', // apply only to nb-calendar with this attribute
|
||||
})
|
||||
export class CalendarAriaLabelDirective implements AfterViewInit {
|
||||
constructor(private el: ElementRef, private renderer: Renderer2) {}
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
const nativeElement = this.el.nativeElement;
|
||||
|
||||
const prevBtn = nativeElement.querySelector('.prev-month');
|
||||
const nextBtn = nativeElement.querySelector('.next-month');
|
||||
|
||||
if (prevBtn) {
|
||||
this.renderer.setAttribute(prevBtn, 'aria-label', 'Go to previous month');
|
||||
}
|
||||
|
||||
if (nextBtn) {
|
||||
this.renderer.setAttribute(nextBtn, 'aria-label', 'Go to next month');
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue