bootstrap-notify
bootstrap-notify copied to clipboard
feature request: settings.delayShow
Can use to delay the showing of the notification. Not sure if useful in other ways, but I needed this in special case to "cascade in and out" a group of notifications generated server-side using an ajax framework and then sent to client browser. It was a little more elegant than handling client-side. defaults.delayShow = 0. Relevant code I added to function Notify()
:
if(this.settings.delayShow > 0){
setTimeout(function(notify){
notify.init();
}, this.settings.delayShow, this);
} else {
this.init();
}
Why have the if
statement. If you just wrapped it in the timeout
wouldn't it activate immediately since the delay would be defaulted to 0
?
Docs mention something about delayed execution even if 0. Played it safe?
Source: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout
Hm...further on the docs suggest even >4 ms.
Yeah, it appears if you use setTimeout to many times it can be set to default 4ms to 10ms based on the browser. On Wed, May 4, 2016 at 10:13 PM Jonathan (J. D.) Uhls < [email protected]> wrote:
Hm...further on the docs suggest even >4 ms.
— You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/mouse0270/bootstrap-notify/issues/143#issuecomment-217059008