| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 8 | 8 |
| 9 factory WheelEvent(String type, | 9 factory WheelEvent(String type, |
| 10 {Window view, int deltaX: 0, int deltaY: 0, | 10 {Window view, int deltaX: 0, int deltaY: 0, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return detail * 40; | 127 return detail * 40; |
| 128 } | 128 } |
| 129 return detail; | 129 return detail; |
| 130 } | 130 } |
| 131 return 0; | 131 return 0; |
| 132 } | 132 } |
| 133 throw new UnsupportedError( | 133 throw new UnsupportedError( |
| 134 'deltaX is not supported'); | 134 'deltaX is not supported'); |
| 135 } | 135 } |
| 136 | 136 |
| 137 int get deltaMode { | |
| 138 if (JS('bool', '!!#.deltaMode', this)) { | |
| 139 // If not available then we're poly-filling and doing pixel scroll. | |
| 140 return 0; | |
| 141 } | |
| 142 return this._deltaMode; | |
| 143 } | |
| 144 | |
| 145 num get _deltaY => JS('num', '#.deltaY', this); | 137 num get _deltaY => JS('num', '#.deltaY', this); |
| 146 num get _deltaX => JS('num', '#.deltaX', this); | 138 num get _deltaX => JS('num', '#.deltaX', this); |
| 147 num get _wheelDelta => JS('num', '#.wheelDelta', this); | 139 num get _wheelDelta => JS('num', '#.wheelDelta', this); |
| 148 num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this); | 140 num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this); |
| 149 num get _detail => JS('num', '#.detail', this); | 141 num get _detail => JS('num', '#.detail', this); |
| 150 int get _deltaMode => JS('int', '#.deltaMode', this); | |
| 151 | 142 |
| 152 bool get _hasInitMouseScrollEvent => | 143 bool get _hasInitMouseScrollEvent => |
| 153 JS('bool', '!!(#.initMouseScrollEvent)', this); | 144 JS('bool', '!!(#.initMouseScrollEvent)', this); |
| 154 | 145 |
| 155 @JSName('initMouseScrollEvent') | 146 @JSName('initMouseScrollEvent') |
| 156 void _initMouseScrollEvent( | 147 void _initMouseScrollEvent( |
| 157 String type, | 148 String type, |
| 158 bool canBubble, | 149 bool canBubble, |
| 159 bool cancelable, | 150 bool cancelable, |
| 160 Window view, | 151 Window view, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 int deltaMode) native; | 184 int deltaMode) native; |
| 194 | 185 |
| 195 $else | 186 $else |
| 196 @DomName('WheelEvent.deltaX') | 187 @DomName('WheelEvent.deltaX') |
| 197 num get deltaX => $dom_wheelDeltaX; | 188 num get deltaX => $dom_wheelDeltaX; |
| 198 @DomName('WheelEvent.deltaY') | 189 @DomName('WheelEvent.deltaY') |
| 199 num get deltaY => $dom_wheelDeltaY; | 190 num get deltaY => $dom_wheelDeltaY; |
| 200 | 191 |
| 201 $endif | 192 $endif |
| 202 } | 193 } |
| OLD | NEW |