Fixed preventDefault()
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/60f223a2 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/60f223a2 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/60f223a2 Branch: refs/heads/feature/strand-work Commit: 60f223a2d0e39b092cd392ab159aeca72174bedf Parents: 9767786 Author: Harbs <ha...@in-tools.com> Authored: Wed Jul 26 14:51:44 2017 +0300 Committer: Harbs <ha...@in-tools.com> Committed: Wed Jul 26 14:51:44 2017 +0300 ---------------------------------------------------------------------- .../org/apache/flex/events/KeyboardEvent.as | 35 ++++++++++++++++++++ .../flex/org/apache/flex/events/MouseEvent.as | 32 ++++++++++++++++++ 2 files changed, 67 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/60f223a2/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as index 29761f7..dda7e0a 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as @@ -210,7 +210,42 @@ package org.apache.flex.events if(wrappedEvent) wrappedEvent.stopPropagation(); } + /** + * Whether the default action has been prevented. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + COMPILE::JS + override public function preventDefault():void + { + wrappedEvent ? wrappedEvent.preventDefault() : super.preventDefault(); + } + COMPILE::JS + private var _defaultPrevented:Boolean; + /** + * Whether the default action has been prevented. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + COMPILE::JS + public function get defaultPrevented():Boolean + { + return wrappedEvent ? wrappedEvent.defaultPrevented : _defaultPrevented; + } + COMPILE::JS + public function set defaultPrevented(value:Boolean):void + { + _defaultPrevented = value; + } + /** * Create a copy/clone of the KeyboardEvent object. * http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/60f223a2/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as index cb52298..1b6fe7e 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as @@ -440,6 +440,38 @@ package org.apache.flex.events } /** + * Whether the default action has been prevented. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + override public function preventDefault():void + { + wrappedEvent ? wrappedEvent.preventDefault() : super.preventDefault(); + } + + private var _defaultPrevented:Boolean; + /** + * Whether the default action has been prevented. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get defaultPrevented():Boolean + { + return wrappedEvent ? wrappedEvent.defaultPrevented : _defaultPrevented; + } + public function set defaultPrevented(value:Boolean):void + { + _defaultPrevented = value; + } + + /** * @private */ private static function installRollOverMixin():Boolean