This is an automated email from the ASF dual-hosted git repository. harbs pushed a commit to branch feature/event-rework in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit b78b464f8ecf29b0bbfe5830f30b6940b3955d02 Author: Harbs <[email protected]> AuthorDate: Wed Jan 1 10:53:00 2020 +0200 Don't subclass goog.event --- .../main/royale/org/apache/royale/events/Event.as | 43 +++++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/Event.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/Event.as index d146568..30b6b94 100644 --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/Event.as +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/Event.as @@ -153,22 +153,26 @@ package org.apache.royale.events * * @royalesuppresspublicvarwarning */ - COMPILE::JS - public class Event extends goog.events.Event implements IRoyaleEvent { + COMPILE::JS + public class Event implements IRoyaleEvent { public static const CHANGE:String = "change"; public static const COMPLETE:String = "complete"; public static const SELECT:String = "select"; public static const OPEN:String = "open"; - public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { - super(type); + public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { + this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; - } + } + public var type:String; + public var target:Object; + public var currentTarget:Object; public var bubbles:Boolean; public var cancelable:Boolean; + /** * Google Closure doesn't seem to support stopImmediatePropagation, but @@ -183,20 +187,39 @@ package org.apache.royale.events return _immediatePropogationStopped; } + private var _propogationStopped:Boolean; + + public function get propogationStopped():Boolean + { + return _propogationStopped; + } + public function stopPropagation():void + { + _propogationStopped = true; + } + public function stopImmediatePropagation():void { _immediatePropogationStopped = true; } - - public function cloneEvent():IRoyaleEvent + private var _defaultPrevented:Boolean; + public function preventDefault():void + { + _defaultPrevented = true; + } + public function get defaultPrevented():Boolean { - return new org.apache.royale.events.Event(type, bubbles, cancelable); + return _defaultPrevented; } - public function isDefaultPrevented():Boolean { - return defaultPrevented; + return _defaultPrevented; } + public function cloneEvent():IRoyaleEvent + { + return new org.apache.royale.events.Event(type, bubbles, cancelable); + } + /** * Determine if the target is the same as the event's target. The event's target
