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

Unified Diff: samples/swarm/swarm_ui_lib/touch/Scrollbar.dart

Issue 12258020: Reverting setTimeout removal. (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
« no previous file with comments | « samples/swarm/swarm_ui_lib/base/base.dart ('k') | samples/swarm/swarm_ui_lib/view/ConveyorView.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
diff --git a/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart b/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
index ac6a8755ab9aa2a16a13ced0af005b502dff4c4e..de8d13c579efed4a873f3123847c2dda8902e98f 100644
--- a/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
+++ b/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
@@ -52,7 +52,7 @@ class Scrollbar implements ScrollListener {
num _currentScrollStartOffset;
bool _currentScrollVertical;
num _currentScrollRatio;
- Timer _timer;
+ num _timerId;
bool _displayOnHover;
bool _hovering = false;
@@ -148,7 +148,7 @@ class Scrollbar implements ScrollListener {
// Start hiding immediately if we aren't
// scrolling or already in the process of
// hidng the scrollbar
- if (!_scrollInProgress && _timer == null) {
+ if (!_scrollInProgress && _timerId == null) {
_boundHideFn();
}
});
@@ -232,8 +232,7 @@ class Scrollbar implements ScrollListener {
*/
void _onScrollerEnd(Event e) {
_cancelTimeout();
- _timer = new Timer(const Duration(milliseconds: _DISPLAY_TIME),
- _boundHideFn);
+ _timerId = window.setTimeout(_boundHideFn, _DISPLAY_TIME);
_scrollInProgress = false;
}
void onScrollerMoved(num scrollX, num scrollY, bool decelerating) {
@@ -282,9 +281,9 @@ class Scrollbar implements ScrollListener {
}
void _cancelTimeout() {
- if (_timer != null) {
- _timer.cancel();
- _timer = null;
+ if (_timerId != null) {
+ window.clearTimeout(_timerId);
+ _timerId = null;
}
}
« no previous file with comments | « samples/swarm/swarm_ui_lib/base/base.dart ('k') | samples/swarm/swarm_ui_lib/view/ConveyorView.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698