refactor(header/notice): convert JS to stimulus

This commit is contained in:
Colin Darie 2022-09-19 16:13:41 +02:00
parent a2c32b44c0
commit 55fd4307a1
5 changed files with 18 additions and 24 deletions

View file

@ -0,0 +1,13 @@
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');
}
}