| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Implementation of a scrollbar for the custom scrolling behavior | 6 * Implementation of a scrollbar for the custom scrolling behavior |
| 7 * defined in [:Scroller:]. | 7 * defined in [:Scroller:]. |
| 8 */ | 8 */ |
| 9 class Scrollbar implements ScrollListener { | 9 class Scrollbar implements ScrollListener { |
| 10 /** | 10 /** |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 _scroller.setPosition(x, y); | 214 _scroller.setPosition(x, y); |
| 215 } | 215 } |
| 216 _currentScrollStartMouse = coordinate; | 216 _currentScrollStartMouse = coordinate; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void _onEnd(UIEvent e) { | 219 void _onEnd(UIEvent e) { |
| 220 _scrollBarDragInProgress = false; | 220 _scrollBarDragInProgress = false; |
| 221 // TODO(jacobr): make scrollbar less tightly coupled to the scroller. | 221 // TODO(jacobr): make scrollbar less tightly coupled to the scroller. |
| 222 _scroller.onScrollerDragEnd.dispatch( | 222 _scroller.onScrollerDragEnd.dispatch( |
| 223 EventUtil.createEvent(ScrollerEventType.DRAG_END)); | 223 new Event(ScrollerEventType.DRAG_END)); |
| 224 } | 224 } |
| 225 | 225 |
| 226 | 226 |
| 227 /** | 227 /** |
| 228 * When scrolling ends, schedule a timeout to hide the scrollbars. | 228 * When scrolling ends, schedule a timeout to hide the scrollbars. |
| 229 */ | 229 */ |
| 230 void _onScrollerEnd(Event e) { | 230 void _onScrollerEnd(Event e) { |
| 231 _cancelTimeout(); | 231 _cancelTimeout(); |
| 232 _timerId = window.setTimeout(_boundHideFn, _DISPLAY_TIME); | 232 _timerId = window.setTimeout(_boundHideFn, _DISPLAY_TIME); |
| 233 _scrollInProgress = false; | 233 _scrollInProgress = false; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 style.setProperty(cssPos, '${pos}px', ''); | 341 style.setProperty(cssPos, '${pos}px', ''); |
| 342 if (_cachedSize[cssSize] != size) { | 342 if (_cachedSize[cssSize] != size) { |
| 343 _cachedSize[cssSize] = size; | 343 _cachedSize[cssSize] = size; |
| 344 style.setProperty(cssSize, '${size}px', ''); | 344 style.setProperty(cssSize, '${size}px', ''); |
| 345 } | 345 } |
| 346 if (element.parent == null) { | 346 if (element.parent == null) { |
| 347 _frame.nodes.add(element); | 347 _frame.nodes.add(element); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 } | 350 } |
| OLD | NEW |