[angular-16-irish-monitor | DONE | CHANGED] cookie banner: parameterize cookie name
This commit is contained in:
parent
736546c0eb
commit
8c5c4923d3
|
@ -66,7 +66,7 @@ export type CookieLawTarget = '_blank' | '_self';
|
|||
})
|
||||
export class CookieLawComponent implements OnInit {
|
||||
public cookieLawSeen: boolean;
|
||||
|
||||
@Input() cookieName = "cookieLawSeen";
|
||||
@Input('learnMore')
|
||||
get learnMore() { return this._learnMore; }
|
||||
set learnMore(value: string) {
|
||||
|
@ -109,7 +109,7 @@ export class CookieLawComponent implements OnInit {
|
|||
this.isSeenEvt = new EventEmitter<boolean>();
|
||||
this.animation = 'topIn';
|
||||
this._position = 'bottom';
|
||||
this.cookieLawSeen = this._service.seen();
|
||||
this.cookieLawSeen = this._service.seen(this.cookieName);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -142,7 +142,7 @@ export class CookieLawComponent implements OnInit {
|
|||
evt.preventDefault();
|
||||
}
|
||||
|
||||
this._service.storeCookie();
|
||||
this._service.storeCookie(this.cookieName);
|
||||
this.animation = this.position === 'top' ? 'topOut' : 'bottomOut';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ import { Injectable } from '@angular/core';
|
|||
export class CookieLawService {
|
||||
|
||||
|
||||
seen(): boolean {
|
||||
return this.cookieExists('cookieLawSeen');
|
||||
seen(cookieName): boolean {
|
||||
return this.cookieExists(cookieName);
|
||||
}
|
||||
|
||||
storeCookie(): void {
|
||||
return this.setCookie('cookieLawSeen');
|
||||
storeCookie(cookieName): void {
|
||||
return this.setCookie('cookieName');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue