]>
BookStack Code Mirror - bookstack/blobdiff - resources/js/components/notification.js
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix-code-block-linefeed' into development
[bookstack]
/
resources
/
js
/
components
/
notification.js
diff --git
a/resources/js/components/notification.js
b/resources/js/components/notification.js
index f7edb08aa1327fda20c76728f2fb8add65119b60..35bab4ea656b1c052e875fac2bcdf0e4ef27d268 100644
(file)
--- a/
resources/js/components/notification.js
+++ b/
resources/js/components/notification.js
@@
-28,7
+28,11
@@
class Notification {
this.elem.classList.add('showing');
}, 1);
this.elem.classList.add('showing');
}, 1);
- if (this.autohide) setTimeout(this.hide.bind(this), 2000);
+ if (this.autohide) {
+ const words = textToShow.split(' ').length;
+ const timeToShow = Math.max(2000, 1000 + (250 * words));
+ setTimeout(this.hide.bind(this), timeToShow);
+ }
}
hide() {
}
hide() {