Chromium Code Reviews| Index: samples/swarm/swarm_ui_lib/view/ConveyorView.dart |
| diff --git a/samples/swarm/swarm_ui_lib/view/ConveyorView.dart b/samples/swarm/swarm_ui_lib/view/ConveyorView.dart |
| index 696c1bd4d74c3ad3c843f3c33b93e31e9bbedcad..87c0710af71221fba597e13611af7e1ce532a88f 100644 |
| --- a/samples/swarm/swarm_ui_lib/view/ConveyorView.dart |
| +++ b/samples/swarm/swarm_ui_lib/view/ConveyorView.dart |
| @@ -23,11 +23,11 @@ class ConveyorView extends CompositeView { |
| // which view is selected? (e.g. the MVVM pattern) |
| Function viewSelected; |
| - int animationTimeoutId; |
| + Timer animationTimer; |
| ConveyorView() |
| : super('conveyor-view', true), |
| - animationTimeoutId = null { |
| + animationTimer = null { |
| } |
| Element render() { |
| @@ -61,13 +61,10 @@ class ConveyorView extends CompositeView { |
| final xTranslationPercent = -index * 100; |
| style.transform = 'translate3d(${xTranslationPercent}%, 0px, 0px)'; |
| - if (animationTimeoutId != null) { |
| - window.clearTimeout(animationTimeoutId); |
| - } |
| - |
| if (animate) { |
| - animationTimeoutId = window.setTimeout( |
| - () { _onAnimationEnd(); }, (durationSeconds * 1000).toInt()); |
| + animationTimer = new Timer( |
| + new Duration(milliseconds: ((durationSeconds * 1000).toInt())), |
|
blois
2013/02/13 03:09:24
Not an issue for your CL, but this seems like it d
floitsch
2013/02/13 10:03:07
We are looking to see if we can add microseconds.
Emily Fortuna
2013/02/13 20:19:44
Done.
|
| + () { _onAnimationEnd(); }); |
| } |
| // TODO(mattsh), we should set the visibility to hide everything but the |
| // selected view. |