2022-09-19 16:13:41 +02:00
|
|
|
import { ApplicationController } from './application_controller';
|
|
|
|
|
|
|
|
export class DSFRHeaderController extends ApplicationController {
|
|
|
|
static targets = ['notice'];
|
|
|
|
|
|
|
|
declare readonly noticeTarget: HTMLElement;
|
|
|
|
|
|
|
|
closeNotice() {
|
|
|
|
this.noticeTarget.parentNode?.removeChild(this.noticeTarget);
|
|
|
|
|
|
|
|
this.element.classList.remove('fr-header__with-notice-info');
|
2024-03-18 19:31:57 +01:00
|
|
|
|
|
|
|
const event = new CustomEvent('noticeClosed', { bubbles: true });
|
|
|
|
this.element.dispatchEvent(event);
|
2022-09-19 16:13:41 +02:00
|
|
|
}
|
|
|
|
}
|