refactor(header/notice): convert JS to stimulus
This commit is contained in:
parent
a2c32b44c0
commit
55fd4307a1
5 changed files with 18 additions and 24 deletions
13
app/javascript/controllers/dsfr_header_controller.ts
Normal file
13
app/javascript/controllers/dsfr_header_controller.ts
Normal 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');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue