diff options
Diffstat (limited to 'WebInterface/NodeJSServer/src/modules/ui/notification-banner.js')
-rw-r--r-- | WebInterface/NodeJSServer/src/modules/ui/notification-banner.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/WebInterface/NodeJSServer/src/modules/ui/notification-banner.js b/WebInterface/NodeJSServer/src/modules/ui/notification-banner.js index 12461fa..7e6b8cb 100644 --- a/WebInterface/NodeJSServer/src/modules/ui/notification-banner.js +++ b/WebInterface/NodeJSServer/src/modules/ui/notification-banner.js @@ -10,6 +10,7 @@ export default class BannerController { * @param {string} notificationBadge ID of badge (# of notifications) */ constructor(bannerId, textP, dismissBtn, notificationBadge) { + this.ids = {bannerId, textP, dismissBtn, notificationBadge}; this.banner = document.getElementById(bannerId); this.bannerText = document.getElementById(textP); this.dismissBtn = document.getElementById(dismissBtn); @@ -30,6 +31,21 @@ export default class BannerController { } /** + * Reloads the object + */ + refresh() { + this.banner = document.getElementById(this.ids.bannerId); + this.bannerText = document.getElementById(this.ids.textP); + this.dismissBtn = document.getElementById(this.ids.dismissBtn); + this.notificationBadge = document.getElementById( + this.ids.notificationBadge); + this.bannerMsgs = []; + + // Hide Banner after JS loading finished + this.banner.classList.add('hidden'); + } + + /** * Pushes a new message to the notification banner and shows it * @param {string} name Name to register notification (referenced in hide) * @param {string} text Notification text |