diff --git a/src/app/components/home/_dialogs/cookies/cookies.component.html b/src/app/components/home/_dialogs/cookies/cookies.component.html index 27a08c1f3e257ad428a1c220f8d8ccedb414bee1..84e886b86a4aadda11a425f82a8665287bd9b25b 100644 --- a/src/app/components/home/_dialogs/cookies/cookies.component.html +++ b/src/app/components/home/_dialogs/cookies/cookies.component.html @@ -8,7 +8,7 @@ </div> <mat-divider></mat-divider> - <mat-dialog-content tabindex="0"> + <mat-dialog-content tabindex="-1"> <app-cookies-de *ngIf="currentLang=='de'"></app-cookies-de> <app-cookies-en *ngIf="currentLang=='en'"></app-cookies-en> diff --git a/src/app/components/home/_dialogs/cookies/cookies.component.ts b/src/app/components/home/_dialogs/cookies/cookies.component.ts index 2dc0291043f7e8440afd9db20c0e7682c1fa8af3..ac3b51184216c30c84ee8a46984a7ffccccfceb0 100644 --- a/src/app/components/home/_dialogs/cookies/cookies.component.ts +++ b/src/app/components/home/_dialogs/cookies/cookies.component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { DataProtectionComponent } from '../data-protection/data-protection.component'; import { MatDialog, MatDialogRef } from '@angular/material'; import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; @@ -8,7 +8,7 @@ import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-act templateUrl: './cookies.component.html', styleUrls: ['./cookies.component.scss'] }) -export class CookiesComponent implements OnInit { +export class CookiesComponent implements OnInit, AfterViewInit { @ViewChild('header') dialogTitle: ElementRef; @@ -18,21 +18,28 @@ export class CookiesComponent implements OnInit { confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Primary; - constructor(private dialog: MatDialog, private dialogRef: MatDialogRef<CookiesComponent>) { + constructor(private dialog: MatDialog, private dialogRef: MatDialogRef<CookiesComponent>, private ref: ElementRef) { } ngOnInit() { + this.currentLang = localStorage.getItem('currentLang'); // not really the nicest way but should do its job until a better or native solution was found setTimeout(() => document.getElementById('cookie-header').focus(), 400); } + ngAfterViewInit() { + setTimeout(() => { + (<HTMLElement>(<HTMLElement>this.ref.nativeElement).getElementsByClassName('mat-dialog-title')[0]).focus(); + }, 500); + } + acceptCookies() { localStorage.setItem('cookieAccepted', 'true'); localStorage.setItem('dataProtectionConsent', 'true'); this.dialogRef.close(true); - setTimeout( () => { + setTimeout(() => { document.getElementById('live_announcer-button').focus(); }, 500); } @@ -44,10 +51,10 @@ export class CookiesComponent implements OnInit { } openDataProtection() { - const dialogRef = this.dialog.open(DataProtectionComponent, { - width: '90%' - }); - dialogRef.componentInstance.deviceType = this.deviceType; + const dialogRef = this.dialog.open(DataProtectionComponent, { + width: '90%' + }); + dialogRef.componentInstance.deviceType = this.deviceType; } /** diff --git a/src/assets/i18n/cookies/cookies-de.html b/src/assets/i18n/cookies/cookies-de.html index 774326b7ecbfcdd06b79ba88ffdc1cb43266817a..16f134667ff3bdc93d299a6663b3c7d1b1cb1994 100644 --- a/src/assets/i18n/cookies/cookies-de.html +++ b/src/assets/i18n/cookies/cookies-de.html @@ -1,11 +1,11 @@ -<p> +<p tabindex="0"> Deine Fragen und Bewertungen sind anonym. Ein »frag.jetzt«-Konto ist nur erforderlich, wenn du als Dozent deine Sitzung für 180 Tage nach dem letzten Besuch speichern willst. </p> <p> Mit Anklicken des Buttons »Akzeptieren« erklärst du dich mit der Verwendung der - <a href="https://de.wikipedia.org/wiki/Web_Storage" target="_blank" rel="noreferrer">Web-Storage-Technik</a> + <a href="https://de.wikipedia.org/wiki/Web_Storage" target="_blank" rel="noreferrer" tabindex="-1">Web-Storage-Technik</a> und unserer Daten­schutz­erklärung einverstanden. Diese kannst du über das Datenschutz-Symbol einsehen. </p> diff --git a/src/assets/i18n/cookies/cookies-en.html b/src/assets/i18n/cookies/cookies-en.html index 4461b765b8ac99b896cd6a3e90516aced27b227f..e389e5f485bfc89cca3e2128753462333dde62d5 100644 --- a/src/assets/i18n/cookies/cookies-en.html +++ b/src/assets/i18n/cookies/cookies-en.html @@ -1,11 +1,11 @@ -<p> +<p tabindex="0"> Your questions and votes are anonymous. A »frag.­jetzt« account is only required, if you as a lecturer want to save your session for 180 days after the last visit. </p> -<p> +<p tabindex="0"> By clicking the button »Accept« you agree to the use of a - <a href="https://en.wikipedia.org/wiki/Web_storage" target="_blank" rel="noreferrer">web storage</a> + <a href="https://en.wikipedia.org/wiki/Web_storage" target="_blank" rel="noreferrer" tabindex="-1">web storage</a> and our privacy policy. You can view our policy by clicking on the data protection symbol above. </p>