flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [02/22] git commit: [flex-asjs] [refs/heads/develop] - use preventDefault to defeat browser drag selection of text and images. Worked for Safari
Date Fri, 09 Jan 2015 16:10:15 GMT
use preventDefault to defeat browser drag selection of text and images.  Worked for 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/942ef40f
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/942ef40f
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/942ef40f

Branch: refs/heads/develop
Commit: 942ef40f7f47b24a0024ff04d0e1ce619d0fafbc
Parents: e6fb065
Author: Alex Harui <aharui@apache.org>
Authored: Tue Jan 6 21:35:21 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Jan 9 08:09:46 2015 -0800

----------------------------------------------------------------------
 .../apache/flex/html/beads/controllers/DragMouseController.as    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/942ef40f/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
index d9be00e..7f439a5 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
@@ -191,6 +191,7 @@ package org.apache.flex.html.beads.controllers
             IUIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_UP,
dragMouseUpHandler);
             mouseDownX = event.screenX;
             mouseDownY = event.screenY;
+            event.preventDefault();
         }
         
         private function dragMouseMoveHandler(event:MouseEvent):void
@@ -199,6 +200,8 @@ package org.apache.flex.html.beads.controllers
             var dragEvent:DragEvent;
             trace("dragMouseMove");
             
+            event.preventDefault();
+            
             if (!dragging)
             {
                 trace("not dragging anything else");
@@ -240,6 +243,7 @@ package org.apache.flex.html.beads.controllers
                 trace("sending dragEnd");
                 dragEvent = DragEvent.createDragEvent("dragEnd", event);
                 DragEvent.dispatchDragEvent(dragEvent, IEventDispatcher(event.target));
+                event.preventDefault();
             }
             dragging = false;
             DragEvent.dragSource = null;


Mime
View raw message