mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:09:52 +01:00
Remove legacy announcement TypeScript
This commit is contained in:
parent
3b1f15ebb9
commit
b51d8c048d
3 changed files with 0 additions and 21 deletions
|
@ -4,7 +4,6 @@ import { Application } from '@hotwired/stimulus';
|
|||
import { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers';
|
||||
|
||||
import start from 'retrospring/common';
|
||||
import initAnnouncements from 'retrospring/features/announcement';
|
||||
import initAnswerbox from 'retrospring/features/answerbox/index';
|
||||
import initInbox from 'retrospring/features/inbox/index';
|
||||
import initUser from 'retrospring/features/user';
|
||||
|
@ -27,7 +26,6 @@ document.addEventListener('turbo:load', initQuestionbox);
|
|||
document.addEventListener('DOMContentLoaded', initQuestion);
|
||||
document.addEventListener('DOMContentLoaded', initModeration);
|
||||
document.addEventListener('DOMContentLoaded', initMemes);
|
||||
document.addEventListener('turbo:load', initAnnouncements);
|
||||
document.addEventListener('turbo:load', initLocales);
|
||||
document.addEventListener('turbo:load', initFront);
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export default function (event: Event): void {
|
||||
const announcement = (event.target as HTMLElement).closest(".announcement") as HTMLDivElement;
|
||||
const announcementId = announcement.dataset.announcementId;
|
||||
window.localStorage.setItem(`announcement${announcementId}`, 'true');
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import registerEvents from 'utilities/registerEvents';
|
||||
import closeAnnouncementHandler from './close';
|
||||
|
||||
export default (): void => {
|
||||
registerEvents([
|
||||
{ type: 'click', target: document.querySelector('.announcement button.close'), handler: closeAnnouncementHandler },
|
||||
]);
|
||||
|
||||
document.querySelectorAll('.announcement').forEach(function (el: HTMLDivElement) {
|
||||
if (!window.localStorage.getItem(`announcement${el.dataset.announcementId}`)) {
|
||||
el.classList.remove('d-none');
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue