Ventus icon indicating copy to clipboard operation
Ventus copied to clipboard

Multiple close/open support

Open gogoprog opened this issue 6 years ago • 1 comments

Hello,

The following:

myWindow.close();
myWindow.open();

during the same JavaScript frame breaks the behavior and the window can be lost forever.

This PR prevents such issue.

Let me know what do you think

gogoprog avatar Jul 18 '18 13:07 gogoprog

I understand the issue here, but I'm not sure if this is the right solution. Generally, this only happens when programmatically you close and then open a window, which occurs so fast that the animationEnd event handler of the open operation is executed before the window is even closed. I don't clearly see the use case however, I would approach this by either:

  1. ignoring any operation if the previous animation has not ended.
  2. enqueuing the operation and execute it whenever the animation has ended by means of promises.

rlamana avatar Jan 20 '19 21:01 rlamana