| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 if (metaKey) { | 43 if (metaKey) { |
| 44 modifiers.push('Meta'); | 44 modifiers.push('Meta'); |
| 45 } | 45 } |
| 46 event._initWheelEvent(type, canBubble, cancelable, view, detail, screenX, | 46 event._initWheelEvent(type, canBubble, cancelable, view, detail, screenX, |
| 47 screenY, clientX, clientY, button, relatedTarget, modifiers.join(' '), | 47 screenY, clientX, clientY, button, relatedTarget, modifiers.join(' '), |
| 48 deltaX, deltaY, 0, 0); | 48 deltaX, deltaY, 0, 0); |
| 49 } else if (event._hasInitMouseScrollEvent) { | 49 } else if (event._hasInitMouseScrollEvent) { |
| 50 var axis = 0; | 50 var axis = 0; |
| 51 var detail = 0; | 51 var detail = 0; |
| 52 if (deltaX != 0 && deltaY != 0) { | 52 if (deltaX != 0 && deltaY != 0) { |
| 53 throw UnsupportedError( | 53 throw new UnsupportedError( |
| 54 'Cannot modify deltaX and deltaY simultaneously'); | 54 'Cannot modify deltaX and deltaY simultaneously'); |
| 55 } | 55 } |
| 56 if (deltaY != 0) { | 56 if (deltaY != 0) { |
| 57 detail = deltaY; | 57 detail = deltaY; |
| 58 axis = JS('int', 'MouseScrollEvent.VERTICAL_AXIS'); | 58 axis = JS('int', 'MouseScrollEvent.VERTICAL_AXIS'); |
| 59 } else if (deltaX != 0) { | 59 } else if (deltaX != 0) { |
| 60 detail = deltaX; | 60 detail = deltaX; |
| 61 axis = JS('int', 'MouseScrollEvent.HORIZONTAL_AXIS'); | 61 axis = JS('int', 'MouseScrollEvent.HORIZONTAL_AXIS'); |
| 62 } | 62 } |
| 63 event._initMouseScrollEvent(type, canBubble, cancelable, view, detail, | 63 event._initMouseScrollEvent(type, canBubble, cancelable, view, detail, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 * [deltaMode]. | 237 * [deltaMode]. |
| 238 * | 238 * |
| 239 * See also: | 239 * See also: |
| 240 * | 240 * |
| 241 * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html
/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C. | 241 * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html
/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C. |
| 242 */ | 242 */ |
| 243 @DomName('WheelEvent.deltaY') | 243 @DomName('WheelEvent.deltaY') |
| 244 num get deltaY => -_wheelDeltaY; | 244 num get deltaY => -_wheelDeltaY; |
| 245 $endif | 245 $endif |
| 246 } | 246 } |
| OLD | NEW |