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

Side by Side Diff: sky/framework/sky-scrollable.sky

Issue 876853005: Add wheel support to sky-scrollable (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add missing files Created 5 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 unified diff | Download patch
« no previous file with comments | « sky/examples/example-scrollable.sky ('k') | sky/viewer/converters/input_event_types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/framework/sky-element/sky-element.sky" as="SkyElement" /> 6 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
7 <import src="/sky/framework/fling-curve.sky" as="FlingCurve" /> 7 <import src="/sky/framework/fling-curve.sky" as="FlingCurve" />
8 8
9 <sky-element 9 <sky-element
10 name="sky-scrollable" 10 name="sky-scrollable"
11 on-gesturescrollstart="handleScrollStart_" 11 on-gesturescrollstart="handleScrollStart_"
12 on-gesturescrollend="handleScrollEnd_" 12 on-gesturescrollend="handleScrollEnd_"
13 on-gesturescrollupdate="handleScrollUpdate_" 13 on-gesturescrollupdate="handleScrollUpdate_"
14 on-gestureflingstart="handleFlingStart_" 14 on-gestureflingstart="handleFlingStart_"
15 on-gestureflingcancel="handleFlingCancel_"> 15 on-gestureflingcancel="handleFlingCancel_"
16 on-wheel="handleWheel_">
16 <template> 17 <template>
17 <style> 18 <style>
18 :host { 19 :host {
19 overflow: hidden; 20 overflow: hidden;
20 position: relative; 21 position: relative;
21 } 22 }
22 #scrollable { 23 #scrollable {
23 transform: translateY(0); 24 transform: translateY(0);
24 } 25 }
25 #vbar { 26 #vbar {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 109 }
109 110
110 handleFlingStart_(event) { 111 handleFlingStart_(event) {
111 this.flingCurve_ = new FlingCurve(-event.velocityY, event.timeStamp); 112 this.flingCurve_ = new FlingCurve(-event.velocityY, event.timeStamp);
112 this.scheduleFlingUpdate_(); 113 this.scheduleFlingUpdate_();
113 } 114 }
114 115
115 handleFlingCancel_(event) { 116 handleFlingCancel_(event) {
116 this.stopFling_(); 117 this.stopFling_();
117 } 118 }
119
120 handleWheel_(event) {
121 this.scrollBy(-event.offsetY);
122 }
118 }.register(); 123 }.register();
119 </script> 124 </script>
120 </sky-element> 125 </sky-element>
OLDNEW
« no previous file with comments | « sky/examples/example-scrollable.sky ('k') | sky/viewer/converters/input_event_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698