X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b94b945fb03e21a1997cfe6e50148967586cb26d..refs/pull/3391/head:/resources/js/components/notification.js diff --git a/resources/js/components/notification.js b/resources/js/components/notification.js index f7edb08aa..35bab4ea6 100644 --- a/resources/js/components/notification.js +++ b/resources/js/components/notification.js @@ -28,7 +28,11 @@ class Notification { 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() {