flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [24/50] git commit: [flex-asjs] [refs/heads/develop] - Fixed mouse BrowserEvent in Safari
Date Mon, 03 Jul 2017 13:35:18 GMT
Fixed mouse BrowserEvent in Safari


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f52192f2
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f52192f2
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f52192f2

Branch: refs/heads/develop
Commit: f52192f2455a0694fac74f5e6749944a6a99e767
Parents: ea6ef4d
Author: Harbs <harbs@in-tools.com>
Authored: Thu Jun 22 14:33:22 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Thu Jun 22 14:33:22 2017 +0300

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/events/BrowserEvent.as   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f52192f2/frameworks/projects/Core/src/main/flex/org/apache/flex/events/BrowserEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/BrowserEvent.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/BrowserEvent.as
index c84eb9f..402fc4d 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/BrowserEvent.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/BrowserEvent.as
@@ -500,9 +500,20 @@ package org.apache.flex.events
 			return wrappedEvent.type;
 		}
 
+		private var _buttons:int = -1;
 		public function get buttonDown():Boolean
 		{
-			return wrappedEvent.event_.buttons == 1;
+			if(_buttons > -1)
+				return _buttons == 1;
+			var ev:* = wrappedEvent.event_;
+			//Safari does not yet support buttons
+			if ('buttons' in ev)
+				return ev["buttons"] == 1;
+			return ev["which"] == 1;
+		}
+		public function set buttonDown(value:Boolean):void
+		{
+			_buttons = value ? 1 : 0;
 		}
 
 		public function get buttons():int


Mime
View raw message