-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix:(animation): Animator does not correctly parse transition durations with multiple values #2381
Conversation
I rebased against latest master and (hopefully) improved the commit message |
|
@cburgdorf - can you take a look at the list here. Most importantly we need a CLA signature and unit tests. |
Hey @petebacondarwin, thanks for taking the time to look through it. The CLA is already signed and I also contributed before (only to docs though). I now changed an existing test since I personally guess that's more appropriate here. If your rather want me to test it seperately I will change that. But the tests would look pretty much identical then. It's rebased against latest master and squashed into one commit. |
Looks good. I'll push it into the CI server for a sanity check. |
Fails on Safari 6.0 Mac: http://ci.angularjs.org/job/angular.js-pete/75/console |
That's a bit weird because I just checked it with Safari 6 and it's picking the highest duration for me. I know absolutely nothing about the testing frameworks Angular uses because I mostly just use qunit. So pardon me, is there any way for me to just run this particular test in safari so that I can hook in with the inspector and attach breakpoints? |
If you have node installed then try: npm install -g grunt-cli then cd into the project directory npm install That should trigger a run with Chrome but you can modify the On 16 April 2013 17:39, Christoph Burgdorf [email protected] wrote:
|
Actually run grunt autotest then change the particular test to from " On 16 April 2013 17:44, Peter Bacon Darwin [email protected] wrote:
|
That's a neat trick with this I fixed the bug with Safari. It was actually a bug within the test as I forgot to vendor prefix one of the css properties. It did work in Chrome as Chrome does not require the vendor prefix anymore. |
@petebacondarwin Can you check against the CI again (or can I do that, too?). It should be fine actually since the test is working for me on Safari locally. Is there anything left for me to do to get that merged? |
Once you guys are close to complete, I can merge this with the other two PRs I have for CSS animations and transition delays. |
I'm would be happy to continue @romiem's work in that other PR (#2396) if that's ok for your @romiem? I would do it in a way that I keep your commit and just amend it so that the commit log shows you as an author. So that we would only have two logical commits but keeping you and me as an author. Guess no one likes to see his work being hidden under a different name ;-) |
Hey there @cburgdorf - apologies for the late reply. That would be great if you could make that change. I had written the function to calculate the max duration+delay pair but hadn't got around to writing unit tests or the other formal process that goes into committing code into Angular. Here is the method that I had written - please feel free to modify as you wish :) |
I should also mention that if you leave the delayString parameter empty, it returns the max duration, which means that we can combine our patches - but I shall await your thoughts on how best to progress this :) |
Hey @matsko I rebased @romiem 's PR on top of mine and and also added a test to take the following case into account:
In this situation the overall time spent is @romiem I liked your approach! I just adjusted minor stuff (e.g. I removed the map since that would result into looping three times instead of just looping once). I made those minor adjustments under your name so that we can stick to only two commits (one by me, one by you). @matsko anything left for us to do or is it ready for you to take over? |
I'm happy to take over, could you provide me with the latest commit so that I can put the final changes together? |
It's all pushed so it's only those two commits here https://github.com/angular/angular.js/pull/2381/commits The first one provides support for multiple durations (cburgdorf@8a3fc7d) and the second one provides support for multiple delays and also takes the special situation about multiple delays and durations into account (cburgdorf@d0288b1) So basically, you can pick or rebase from my PR2373 branch. |
Going to combine this into a larger commit. Plans are to change |
@@ -267,6 +267,25 @@ var $AnimatorProvider = function() { | |||
// $window.setTimeout(beginAnimation, 0); this was causing the element not to animate | |||
// keep at 1 for animation dom rerender | |||
$window.setTimeout(beginAnimation, 1); | |||
|
|||
function savelySplitByComma(str){ |
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.
savely -> safely???
move to top level
Ok, I made those changes now and forced push the branch. @matsko I think if you already rebased on top of this, then you probably don't care about this PR update and just apply them again in your already rebased branch. On the other hand, if you haven't already started rebasing on top of this PR, then we might just merge it to master and you rebase on master then? @mhevery I put I also did the other stuff. I just left the |
In case multiple durations are specified like so: transition-duration: 0.5s, 3000ms; transition-property: left, height; The animator will pick the longest duration. Fixes angular#2373
The code also handles situations with multiple different delay and duration values. E.g. in the following example, the correct duration would be 3 seconds: property | duration | delay height | 1s | 2s left | 2s | 1s opacity | 1s | 2s
Hey guys. Sorry for being out of touch. There are bunch of fixes for animations that are taking place so I'm merging your commits into a bigger PR. |
Landed in: Thank you guys for the animator and test code. |
@cburgdorf, please close the PR. This feature is complete and it will be 1.1.5. |
Done |
This fixes #2373
Unfortunately I don't really know how to write tests for that. Any idea would be welcome.