2022-01-09 08:26:38 -08:00
|
|
|
import registerEvents from 'utilities/registerEvents';
|
|
|
|
import closeAnnouncementHandler from './close';
|
|
|
|
|
|
|
|
export default (): void => {
|
|
|
|
registerEvents([
|
2022-01-09 09:34:19 -08:00
|
|
|
{ type: 'click', target: document.querySelector('.announcement button.close'), handler: closeAnnouncementHandler },
|
2022-01-09 08:26:38 -08:00
|
|
|
]);
|
|
|
|
|
|
|
|
document.querySelectorAll('.announcement').forEach(function (el: HTMLDivElement) {
|
|
|
|
if (!window.localStorage.getItem(el.dataset.announcementId)) {
|
|
|
|
el.classList.remove('d-none');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|