| 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 part of touch; | 5 part of touch; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Implementation of a custom scrolling behavior. | 8 * Implementation of a custom scrolling behavior. |
| 9 * This behavior overrides native scrolling for an area. This area can be a | 9 * This behavior overrides native scrolling for an area. This area can be a |
| 10 * single defined part of a page, the entire page, or several different parts | 10 * single defined part of a page, the entire page, or several different parts |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 _minOffset.x = 0; | 534 _minOffset.x = 0; |
| 535 _minOffset.y = 0; | 535 _minOffset.y = 0; |
| 536 reconfigure(() => _setContentOffset(_maxPoint.x, _maxPoint.y)); | 536 reconfigure(() => _setContentOffset(_maxPoint.x, _maxPoint.y)); |
| 537 } | 537 } |
| 538 | 538 |
| 539 /** | 539 /** |
| 540 * Recalculate dimensions of the frame and the content. Adjust the minPoint | 540 * Recalculate dimensions of the frame and the content. Adjust the minPoint |
| 541 * and maxPoint allowed for scrolling. | 541 * and maxPoint allowed for scrolling. |
| 542 */ | 542 */ |
| 543 void _resize(Callback callback) { | 543 void _resize(Callback callback) { |
| 544 window.setImmediate(() { | 544 window.immediate.then((_) { |
| 545 if (_lookupContentSizeDelegate != null) { | 545 if (_lookupContentSizeDelegate != null) { |
| 546 _contentSize = _lookupContentSizeDelegate(); | 546 _contentSize = _lookupContentSizeDelegate(); |
| 547 } else { | 547 } else { |
| 548 _contentSize = new Size(_element.scrollWidth, _element.scrollHeight); | 548 _contentSize = new Size(_element.scrollWidth, _element.scrollHeight); |
| 549 } | 549 } |
| 550 | 550 |
| 551 _scrollSize = new Size(_frame.offsetWidth, | 551 _scrollSize = new Size(_frame.offsetWidth, |
| 552 _frame.offsetHeight); | 552 _frame.offsetHeight); |
| 553 Size adjusted = _getAdjustedContentSize(); | 553 Size adjusted = _getAdjustedContentSize(); |
| 554 _maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y); | 554 _maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 for (EventListener listener in _listeners) { | 713 for (EventListener listener in _listeners) { |
| 714 listener(evt); | 714 listener(evt); |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 } | 717 } |
| 718 | 718 |
| 719 class ScrollerScrollTechnique { | 719 class ScrollerScrollTechnique { |
| 720 static const TRANSFORM_3D = 1; | 720 static const TRANSFORM_3D = 1; |
| 721 static const RELATIVE_POSITIONING = 2; | 721 static const RELATIVE_POSITIONING = 2; |
| 722 } | 722 } |
| OLD | NEW |