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) {
|
2022-01-09 09:46:50 -08:00
|
|
|
if (!window.localStorage.getItem(`announcement${el.dataset.announcementId}`)) {
|
2022-01-09 08:26:38 -08:00
|
|
|
el.classList.remove('d-none');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|