This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
force animation complete after 5 seconds
- Loading branch information
Yvonne Yip
committed
Jun 20, 2014
1 parent
446c0b6
commit 011f69c
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
011f69c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there,
Is there a reason to enforce animation to complete after 5 seconds? I'm using a custom duration here which is only 300ms via window.CoreStyle.g.transitions.duration. If the animation is enforced to complete after 5 seconds, the hiding page will block the showing page after 5 seconds which is quite weird.
PS: It seems like the hiding page is invisible on top of the showing page and only hide completely after this 5 seconds.
011f69c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout is to handle the case if there's no
transitionend
for some reason, e.g. if no transition was run. I would expect if the transition with a duration of 300ms is run normally,complete
will be called after ~300ms and the 5 second timeout will have no effect.011f69c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. But the current situation is that
this.complete()
only gets called after 5 seconds regardless what duration I've set viawindow.CoreStyle.g.transitions.duration = '300ms'
and it works totally fine if I change line 337 to:this.animating = this.async(this.complete.bind(this), null, CoreStyle.g.transitions.duration);
Any clue on why this happens? Thanks.
011f69c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
complete
is also triggered by thetransitionend
event, see https://github.com/Polymer/core-animated-pages/blob/master/transitions/core-transition-pages.html#L121 .011f69c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, thanks.