Skip to content

Commit 7043796

Browse files
committed
Persistent cookie consent choice
Stores in localstorage when a user dismisses the cookie message, so that it does not return at refresh.
1 parent 08ef25b commit 7043796

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: assets/js/init.js

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
$('.scrollspy').scrollSpy();
1010
$('.tap-target').tapTarget('open');
1111

12+
if (localStorage.getItem('cookieconsent') === 'true') {
13+
$('#cookies').hide()
14+
}
15+
1216
jQuery('#cookies').on('click', function(event) {
17+
localStorage.setItem('cookieconsent', 'true')
1318
jQuery('#cookies').toggle('hide');
1419
});
1520

0 commit comments

Comments
 (0)