2021-09-07 12:08:46 +02:00
|
|
|
var announcement = document.getElementById('announcement');
|
|
|
|
|
|
|
|
if (announcement !== null) {
|
|
|
|
|
2022-01-14 12:14:35 +01:00
|
|
|
var id = announcement.dataset.id;
|
|
|
|
|
|
|
|
Object.keys(localStorage).forEach(function(key) {
|
|
|
|
if (/^global-alert-/.test(key)) {
|
|
|
|
if (key !== id ) {
|
|
|
|
localStorage.removeItem(key);
|
|
|
|
document.documentElement.removeAttribute('data-global-alert');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-09-07 12:08:46 +02:00
|
|
|
|
|
|
|
announcement.addEventListener('closed.bs.alert', () => {
|
2022-01-14 12:14:35 +01:00
|
|
|
localStorage.setItem(id, 'closed');
|
2021-09-07 12:08:46 +02:00
|
|
|
});
|
|
|
|
|
2022-01-14 12:14:35 +01:00
|
|
|
}
|