Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Immediate display mode #160

Closed
ghost opened this Issue Nov 5, 2013 · 3 comments

Comments

2 participants
@ghost

ghost commented Nov 5, 2013

JQuery Noty is a great plugin! However, I'm having a slight issue trying to use it and would really appreciate an "immediate display" mode.

Currently, when you display a Noty it will initiate an animation to render the actual noty. However, in my usage I would like to display a note and then do a bunch of expensive work. Since this environment is currently single-threaded that means that after creating the noty the browser is busy with the work and never gets to the animation to display the noty. My current workaround for this is to pass a continuation as an afterShow callback which will start the expensive work only after the noty is displayed. However, the problem with this is that it causes an additional delay since the animation can only be set to 100ms or so to actually show up.

Additionally, I want to dismiss this noty when the work is done. However, noty does not currently allow close() from within the afterShow callback. My workaround for this is to manually set "shown" immediately after creating the noty so it is set when the afterShow callback executes.

Contributor

blittle commented Dec 24, 2013

Does it work to just set the default animation time?

$.noty.defaults.animation.speed  = 0;
@ghost

ghost commented Dec 26, 2013

No, unfortunately when the time was set too low the popup failed to render at all. If that is timing-dependent then there may be a bug/issue there.

Owner

needim commented Nov 21, 2014

In v2.3.1 we can use animate.css classes for open and closing animations. Actually you can give custom css classes too for animations. For example:

.open-anim {
    display: block;
}

.close-anim {
    display: none
}

usage;

$.noty.defaults.animation = {
        open: 'open-anim',
        close: 'close-anim'
};

@erickskrauch Can you create an example on jsfiddle?

@needim needim closed this Nov 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment