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

Finish hiding loading screen even if tab is hidden #8

Merged
merged 2 commits into from
Apr 8, 2015

Conversation

NevilleS
Copy link
Contributor

@NevilleS NevilleS commented Apr 7, 2015

This is an unfortunate side effect of the nice fade in/out CSS animations PleaseWait uses. These animations are delayed until the tab regains focus, which makes it look like the site hasn't finished loading until the tab is visible (even if finish() was called minutes ago). This fix has two parts:

  1. Use visibility API to skip the fade out animation if the tab is hidden when finish() is called
  2. Use event.stopPropagation() and a finishing flag instead of setTimeout to handle the conflicting event listeners

This is an unfortunate side effect of the nice fade in/out CSS animations PleaseWait uses. These
animations are delayed until the tab regains focus, which makes it *look* like the site hasn't
finished loading until the tab is visible (even if `finish()` was called minutes ago). This fix has
two parts:

1) Use visibility API to skip the fade out animation if the tab is hidden when finish() is called
2) Use event.stopPropagation() and a finishing flag instead of setTimeout to handle the conflicting
event listeners
jhdavids8 added a commit that referenced this pull request Apr 8, 2015
Finish hiding loading screen even if tab is hidden
@jhdavids8 jhdavids8 merged commit d84f41e into master Apr 8, 2015
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

Successfully merging this pull request may close these issues.

2 participants