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 class _ChildrenElementList extends ListBase<Element> | 7 class _ChildrenElementList extends ListBase<Element> |
8 implements NodeListWrapper { | 8 implements NodeListWrapper { |
9 // Raw Element. | 9 // Raw Element. |
10 final Element _element; | 10 final Element _element; |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 * Static factory designed to expose `mousewheel` events to event | 937 * Static factory designed to expose `mousewheel` events to event |
938 * handlers that are not necessarily instances of [Element]. | 938 * handlers that are not necessarily instances of [Element]. |
939 * | 939 * |
940 * See [EventStreamProvider] for usage information. | 940 * See [EventStreamProvider] for usage information. |
941 */ | 941 */ |
942 @DomName('Element.mouseWheelEvent') | 942 @DomName('Element.mouseWheelEvent') |
943 static const EventStreamProvider<WheelEvent> mouseWheelEvent = | 943 static const EventStreamProvider<WheelEvent> mouseWheelEvent = |
944 const _CustomEventStreamProvider<WheelEvent>( | 944 const _CustomEventStreamProvider<WheelEvent>( |
945 Element._determineMouseWheelEventType); | 945 Element._determineMouseWheelEventType); |
946 | 946 |
947 static String _determineMouseWheelEventType(EventTarget e) { | 947 static String _determineMouseWheelEventType(EventTarget e) => 'wheel'; |
948 if (JS('bool', '#.onwheel !== undefined', e)) { | |
949 // W3C spec, and should be IE9+, but IE has a bug exposing onwheel. | |
950 return 'wheel'; | |
951 } else if (JS('bool', '#.onmousewheel !== undefined', e)) { | |
952 // Chrome & IE | |
953 return 'mousewheel'; | |
954 } else { | |
955 // Firefox | |
956 return 'DOMMouseScroll'; | |
957 } | |
958 } | |
959 | 948 |
960 /** | 949 /** |
961 * Static factory designed to expose `transitionend` events to event | 950 * Static factory designed to expose `transitionend` events to event |
962 * handlers that are not necessarily instances of [Element]. | 951 * handlers that are not necessarily instances of [Element]. |
963 * | 952 * |
964 * See [EventStreamProvider] for usage information. | 953 * See [EventStreamProvider] for usage information. |
965 */ | 954 */ |
966 @DomName('Element.transitionEndEvent') | 955 @DomName('Element.transitionEndEvent') |
967 static const EventStreamProvider<TransitionEvent> transitionEndEvent = | 956 static const EventStreamProvider<TransitionEvent> transitionEndEvent = |
968 const _CustomEventStreamProvider<TransitionEvent>( | 957 const _CustomEventStreamProvider<TransitionEvent>( |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 const ScrollAlignment._internal(this._value); | 1566 const ScrollAlignment._internal(this._value); |
1578 toString() => 'ScrollAlignment.$_value'; | 1567 toString() => 'ScrollAlignment.$_value'; |
1579 | 1568 |
1580 /// Attempt to align the element to the top of the scrollable area. | 1569 /// Attempt to align the element to the top of the scrollable area. |
1581 static const TOP = const ScrollAlignment._internal('TOP'); | 1570 static const TOP = const ScrollAlignment._internal('TOP'); |
1582 /// Attempt to center the element in the scrollable area. | 1571 /// Attempt to center the element in the scrollable area. |
1583 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1572 static const CENTER = const ScrollAlignment._internal('CENTER'); |
1584 /// Attempt to align the element to the bottom of the scrollable area. | 1573 /// Attempt to align the element to the bottom of the scrollable area. |
1585 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1574 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
1586 } | 1575 } |
OLD | NEW |