bootstrap-notify icon indicating copy to clipboard operation
bootstrap-notify copied to clipboard

feature request: settings.delayShow

Open jduhls opened this issue 8 years ago • 4 comments

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();
}

jduhls avatar May 04 '16 21:05 jduhls

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?

mouse0270 avatar May 05 '16 00:05 mouse0270

Docs mention something about delayed execution even if 0. Played it safe?

Source: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout

jduhls avatar May 05 '16 02:05 jduhls

Hm...further on the docs suggest even >4 ms.

jduhls avatar May 05 '16 02:05 jduhls

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

mouse0270 avatar May 05 '16 02:05 mouse0270