OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <import src="sky-element.sky" /> | 6 <import src="sky-element.sky" /> |
7 | 7 |
8 <sky-element> | 8 <sky-element> |
9 <template> | 9 <template> |
10 <style> | 10 <style> |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 </style> | 31 </style> |
32 <div id="scrollable"> | 32 <div id="scrollable"> |
33 <content /> | 33 <content /> |
34 </div> | 34 </div> |
35 <div id="vbar" /> | 35 <div id="vbar" /> |
36 </template> | 36 </template> |
37 <script> | 37 <script> |
38 import "dart:math" as math; | 38 import "dart:math" as math; |
39 import "dart:sky"; | 39 import "dart:sky"; |
40 import "fling-curve.dart"; | 40 import "animation/fling-curve.dart"; |
41 import "view-configuration.dart" as config; | 41 import "theme/view-configuration.dart" as config; |
42 | 42 |
43 @Tagname('sky-scrollable') | 43 @Tagname('sky-scrollable') |
44 class SkyScrollable extends SkyElement { | 44 class SkyScrollable extends SkyElement { |
45 Element _scrollable; | 45 Element _scrollable; |
46 Element _vbar; | 46 Element _vbar; |
47 double _scrollOffset = 0.0; | 47 double _scrollOffset = 0.0; |
48 FlingCurve _flingCurve; | 48 FlingCurve _flingCurve; |
49 int _flingAnimationId; | 49 int _flingAnimationId; |
50 | 50 |
51 SkyScrollable() { | 51 SkyScrollable() { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 void _handleWheel(WheelEvent event) { | 155 void _handleWheel(WheelEvent event) { |
156 scrollBy(-event.offsetY); | 156 scrollBy(-event.offsetY); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 _init(script) => register(script, SkyScrollable); | 160 _init(script) => register(script, SkyScrollable); |
161 </script> | 161 </script> |
162 </sky-element> | 162 </sky-element> |
OLD | NEW |