Unable to close a noty that is opening #210

Closed
lgm42 opened this Issue Jul 10, 2014 · 6 comments

Comments

3 participants

lgm42 commented Jul 10, 2014

I launch an async task to do.
Before making it I call

var n = noty({text: "test", timeout:4000,  layout:defaultNotyLayout, type:'information' });

At the end of the async task i call

n.close();

But sometimes my task take a very little time and the noty is not fully loaded before receiving close action and the noty don't close.

I watch the code and I see the use of queue() method that ask a self.close method. Great !

But when I go in debug I see that close method was put in the queue after the timeout method.
In debug I call the method : self.$bar.queue() just after applying queue method in the close() method and I get this values :

["inprogress", function (b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}}, function () {
                  self.close.apply(self);
                }]

lgm42 commented Jul 29, 2014

no idea ?

Aphax commented Aug 14, 2014

Hi,

I was in the same situation, in case you haven't figured out a solution, I've found this one :

n.close();
if(n.showing)
  n.$bar.dequeue();

If noty is performing a showing method (the one who creates the conflict), it will force noty to go directly to the next queue call, who is the closing one.

Hope this help !

lgm42 commented Aug 14, 2014

Thanks A lot I'll make a try immediately !

needim closed this Sep 22, 2014

lgm42 commented Sep 22, 2014

It is not possible to make a correction directly in the library ? Because it's very boring to insert that piece of code each time I make a noty ....

@needim needim added a commit that referenced this issue Sep 22, 2014

@needim needim Resolve #210 #204 a890c54

@needim needim added a commit that referenced this issue Sep 22, 2014

@needim needim v2.2.8 release - Resolve #210 #204 f9281ac
Owner

needim commented Sep 22, 2014

Hi, can you try v2.2.8. I think its ok now.

lgm42 commented Sep 22, 2014

ok thanks you very much

2014-09-22 14:21 GMT+02:00 Nedim Arabacı notifications@github.com:

Hi, can you try v2.2.8. I think its ok now.


Reply to this email directly or view it on GitHub
#210 (comment).

Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.Tout message
electronique est susceptible d'alteration.

This message and any attachments ( the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.E-mails are susceptible

to alteration.

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