File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 1
1
import "../css/main.css" ;
2
2
3
3
document . addEventListener ( "DOMContentLoaded" , function ( ) {
4
- document
5
- . querySelector ( ".rvo-alert .rvo-button__close" )
6
- . addEventListener ( "click" , function ( event ) {
7
- const parrent = event . target . closest ( ".rvo-alert" ) ;
8
- parrent . style . display = "none" ;
4
+ document . querySelectorAll ( ".rvo-alert" ) . forEach ( function ( alertDiv ) {
5
+ const closeButton = alertDiv . querySelector ( ".rvo-button__close" ) ;
6
+ const alertId = alertDiv . getAttribute ( "data-alert-id" ) ;
7
+
8
+ if ( localStorage . getItem ( `alertClosed-${ alertId } ` ) === "true" ) {
9
+ alertDiv . style . display = "none" ;
10
+ }
11
+
12
+ closeButton . addEventListener ( "click" , function ( event ) {
13
+ alertDiv . style . display = "none" ;
14
+
15
+ // Set a localStorage item to remember the alert is closed
16
+ localStorage . setItem ( `alertClosed-${ alertId } ` , "true" ) ;
9
17
} ) ;
18
+ } ) ;
10
19
} ) ;
Original file line number Diff line number Diff line change 33
33
< div
34
34
class ="rvo-max-width-layout rvo-max-width-layout--md rvo-min-width-layout--sm "
35
35
>
36
- < div class ="rvo-alert rvo-alert--info rvo-alert--padding-md ">
36
+ < div
37
+ class ="rvo-alert rvo-alert--info rvo-alert--padding-md "
38
+ data-alert-id ="index-poc-alert "
39
+ >
37
40
< span
38
41
class ="utrecht-icon rvo-icon rvo-icon-info rvo-icon--xl rvo-status-icon-info "
39
42
role ="img "
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ module.exports = {
49
49
filename : "assets/images/[name][ext][query]" ,
50
50
} ,
51
51
} ,
52
+ {
53
+ test : / \. ( w o f f | w o f f 2 | e o t | t t f | o t f ) $ / i,
54
+ type : "asset/resource" ,
55
+ generator : {
56
+ filename : "assets/fonts/[name][ext][query]" ,
57
+ } ,
58
+ } ,
52
59
] ,
53
60
} ,
54
61
optimization : {
You can’t perform that action at this time.
0 commit comments