]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/components/notification.js
Updated 'Spanish Argentina' translation.
[bookstack] / resources / assets / js / components / notification.js
index c352a9c85328d7f9f412d83eb736f08569db48d7..f7edb08aa1327fda20c76728f2fb8add65119b60 100644 (file)
@@ -6,11 +6,16 @@ class Notification {
         this.type = elem.getAttribute('notification');
         this.textElem = elem.querySelector('span');
         this.autohide = this.elem.hasAttribute('data-autohide');
+        this.elem.style.display = 'grid';
+
         window.$events.listen(this.type, text => {
             this.show(text);
         });
         elem.addEventListener('click', this.hide.bind(this));
-        if (elem.hasAttribute('data-show')) this.show(this.textElem.textContent);
+
+        if (elem.hasAttribute('data-show')) {
+            setTimeout(() => this.show(this.textElem.textContent), 100);
+        }
 
         this.hideCleanup = this.hideCleanup.bind(this);
     }
@@ -38,4 +43,4 @@ class Notification {
 
 }
 
-module.exports = Notification;
\ No newline at end of file
+export default Notification;
\ No newline at end of file