summaryrefslogtreecommitdiff
path: root/WebInterface/NodeJSServer/src/modules/ui/notification-banner.js
diff options
context:
space:
mode:
authorTrueKuehli <rctcoaster2000@hotmail.de>2018-10-01 18:10:37 +0200
committerTrueKuehli <rctcoaster2000@hotmail.de>2018-10-01 18:10:37 +0200
commit6f162dcf90a6aa671eb351dc25cb01e2d9cbd3cb (patch)
treece9121463419cb27e6bd4e0c4215c037550f8ff7 /WebInterface/NodeJSServer/src/modules/ui/notification-banner.js
parente463bf3eb7115f1f141da2162b0624f90472ff9c (diff)
A lot of changes
I shoud have written a better commit, I know!
Diffstat (limited to 'WebInterface/NodeJSServer/src/modules/ui/notification-banner.js')
-rw-r--r--WebInterface/NodeJSServer/src/modules/ui/notification-banner.js16
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