Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: samples/swarm/swarm_ui_lib/view/ConveyorView.dart

Issue 12259037: Reapply remove setTimeout, take 3. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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())),
+ () { _onAnimationEnd(); });
}
// TODO(mattsh), we should set the visibility to hide everything but the
// selected view.
« no previous file with comments | « samples/swarm/swarm_ui_lib/touch/Scrollbar.dart ('k') | samples/tests/samples/dartcombat/dartcombat_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698