authelia/docs/assets/js/alert.js
James Elliott b2c60ef898
feat: major documentation refresh (#3475)
This marks the launch of the new documentation website.
2022-06-15 17:51:47 +10:00

20 lines
480 B
JavaScript

var announcement = document.getElementById('announcement');
if (announcement !== null) {
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');
}
}
});
announcement.addEventListener('closed.bs.alert', () => {
localStorage.setItem(id, 'closed');
});
}