durgaprassad7 / simplemodal

Automatically exported from code.google.com/p/simplemodal
0 stars 0 forks source link

Version 1.4.4 introduces asynchronous behaviour in close() #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

It seems that as of version 1.4.1, close() uses setTimeout() to reset the 
dialog object. The new asynchronous behaviour is unfortunately making it harder 
for us to use simplemodal, for example:

* Open dialog XYZ
* When the user validates, close XYZ and open a "please wait" dialog

The last 2 actions could be done in sequence before, but now need an extra 
timeout to wait for the dialog object to be cleared. Without this the second 
call to open() now returns false.

Similar cases happen when writing javascript unit tests, which now need to 
handle asynchronous code.

Is the new setTimeout() related to the Opera work around? Could you recommend 
any alternative solution?

Many thanks

Original issue reported on code.google.com by choicesm...@gmail.com on 1 Dec 2010 at 7:03

GoogleCodeExporter commented 8 years ago
Thanks for bringing up this issue. I'm pretty sure it was for Opera only, but 
I'll need to think about a solution.

If you have any suggestions, feel free to let me know.

Original comment by emartin24 on 3 Dec 2010 at 12:32

GoogleCodeExporter commented 8 years ago
I had the same problem and simply comment out that timeout.
I can't see any problems with current Opera version.

Original comment by fredeckb...@googlemail.com on 7 Dec 2010 at 11:54

GoogleCodeExporter commented 8 years ago
There is a big problem using the setTimeout in close method: if I call $.modal 
immediatly after the close call, the new modal window don't appear because of 
setitmeout destroy it!
I'm using the version 1.4.1 with jQuery 1.4.4 on Firefox 3.6.13 and Chrome dev 
10.0.648.11.

Original comment by sbarex on 1 Feb 2011 at 10:28

GoogleCodeExporter commented 8 years ago
Same problem here. Removed the settimeout from the code for the moment.

if you don't find a clean solution, perhaps just add an param in the close 
method ?

close(instant)

if instant = true, close without settimeout, if false (default value) close 
with timeout.

Original comment by bonux...@gmail.com on 16 May 2011 at 11:22