Skip to content
Snippets Groups Projects
Commit 898447d2 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Show notification before open blog, dsgvo or imprint

parent 0f7ec400
1 merge request!139Resolve "Various improvements"
......@@ -23,16 +23,34 @@ export class FooterComponent implements OnInit {
}
navToBlog() {
this.notificationService.show('Der Blog wird in einem neuen Fenster geöffnet', 'Okay!' , {
duration: 3000
this.notificationService.show('Der Blog wird in einem neuen Fenster geöffnet..', 'Öffnen' , {
duration: 5000
});
this.notificationService.snackRef.afterDismissed().subscribe(info => {
if (info.dismissedByAction === true) {
window.open(this.blogUrl, '_blank');
}
});
window.open(this.blogUrl, '_blank');
}
navToDSGVO() {
window.open(this.dsgvoUrl, '_blank');
this.notificationService.show('Die Datenschutzverordnung wird in einem neuen Fenster geöffnet..', 'Öffnen' , {
duration: 5000
});
this.notificationService.snackRef.afterDismissed().subscribe(info => {
if (info.dismissedByAction === true) {
window.open(this.dsgvoUrl, '_blank');
}
});
}
navToImprint() {
window.open(this.imprUrl, '_blank');
this.notificationService.show('Das Impressum wird in einem neuen Fenster geöffnet..', 'Öffnen' , {
duration: 5000
});
this.notificationService.snackRef.afterDismissed().subscribe(info => {
if (info.dismissedByAction === true) {
window.open(this.imprUrl, '_blank');
}
});
}
}
......@@ -6,12 +6,13 @@ export class NotificationService {
private defaultConfig = {
duration: 2000
};
public snackRef: any;
constructor(private snackBar: MatSnackBar) {
constructor(public snackBar: MatSnackBar) {
}
show(message: string, action?: string, config?: MatSnackBarConfig) {
// Delegate the message and merge the (optionally) passed config with the default config
this.snackBar.open(message, action, Object.assign({}, this.defaultConfig, config));
this.snackRef = this.snackBar.open(message, action, Object.assign({}, this.defaultConfig, config));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment