Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing issue when closing a popup #67

Open
dannygorton opened this issue Feb 20, 2017 · 0 comments
Open

Timing issue when closing a popup #67

dannygorton opened this issue Feb 20, 2017 · 0 comments

Comments

@dannygorton
Copy link

I'm using verion 1.7.6, but this happened on the older versions too: If popup('hide') is called too soon after popup('show') then the hide never happens and the popup just hangs. The only way to recover is to reload the page.

I sometimes use the popup as a busy indicator when calling web services. For some calls I cache the data retrieved into local storage, so I don't need to pull it from the server all the time. When pulling data from the cache, the response is very fast and the 'hide' call executes before the 'show' call completes.

I'm pretty sure this is due to the delay built into the 'show' call on line 325. I know that timer is supposedly handled in the 'hide' call but it doesn't solve this problem. It seems there might be a race condition on that timer. However, I was able to solve the problem by wrapping lines 464-479-ish in a similar setTimeout call with at 25 ms delay. I'm not sure this is the correct solution overall but it seems so far that it solves my issue of 'orphaned' popups.

Any suggestions on this approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant