flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [12/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - fix drag/drop now that we're finally using cross-compiled version
Date Thu, 17 Dec 2015 07:54:22 GMT
fix drag/drop now that we're finally using cross-compiled version


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

Branch: refs/heads/develop
Commit: 094395209b74ad544065e56288e382de6a8e1c95
Parents: f6166dd
Author: Alex Harui <aharui@apache.org>
Authored: Wed Dec 2 11:35:41 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Dec 2 11:35:41 2015 -0800

----------------------------------------------------------------------
 .../as/src/org/apache/flex/events/DragEvent.as  | 24 ++++++++++++++++++--
 .../beads/controllers/DropMouseController.as    | 10 +++++---
 2 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/09439520/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
index c7dec05..7d9fefb 100644
--- a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
+++ b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
@@ -296,6 +296,7 @@ package org.apache.flex.events
          *  @productversion FlexJS 0.0
          *  @flexjsignorecoercion org.apache.flex.events.DragEvent
          *  @flexjsignorecoercion window.Event
+         *  @flexjsignorecoercion Event
          */
         public static function createDragEvent(type:String, event:MouseEvent):DragEvent
         {
@@ -314,7 +315,7 @@ package org.apache.flex.events
             }
             COMPILE::JS
             {
-                var out:MouseEvent = new MouseEvent(type);
+                var out:window.MouseEvent = new window.MouseEvent(type);
                 var e:window.Event = event as window.Event;
                 (out as window.Event).initMouseEvent(type, true, true,
                     e.view, e.detail, e.screenX, e.screenY,
@@ -349,5 +350,24 @@ package org.apache.flex.events
                 (target as IUIBase).element.dispatchEvent(event as window.Event);
             }
         }
-	}
+
+        /**
+         */
+        COMPILE::JS
+        private static function installDragEventMixin():Boolean 
+        {
+            var o:Object = org.apache.flex.events.ElementEvents.elementEvents;
+            o['dragEnd'] = 1;
+            o['dragMove'] = 1;
+            return true;
+        }
+        
+        
+        /**
+         * Add some other events to listen from the element
+         */
+        COMPILE::JS
+        private static var dragEventMixin:Boolean = installDragEventMixin();
+
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/09439520/frameworks/projects/DragDrop/as/src/org/apache/flex/html/beads/controllers/DropMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/as/src/org/apache/flex/html/beads/controllers/DropMouseController.as
b/frameworks/projects/DragDrop/as/src/org/apache/flex/html/beads/controllers/DropMouseController.as
index 03afba6..3165241 100644
--- a/frameworks/projects/DragDrop/as/src/org/apache/flex/html/beads/controllers/DropMouseController.as
+++ b/frameworks/projects/DragDrop/as/src/org/apache/flex/html/beads/controllers/DropMouseController.as
@@ -130,6 +130,7 @@ package org.apache.flex.html.beads.controllers
         
         /**
          *  @private
+		 * @flexjsignorecoercion org.apache.flex.events.MouseEvent
          */
         private function dragMoveHandler(event:DragEvent):void
         {
@@ -137,7 +138,7 @@ package org.apache.flex.html.beads.controllers
             var dragEvent:DragEvent;
             if (!inside)
             {
-                dragEvent = DragEvent.createDragEvent("dragEnter", event);
+                dragEvent = DragEvent.createDragEvent("dragEnter", event as MouseEvent);
                 dispatchEvent(dragEvent);
                 inside = true;
                 IUIBase(_strand).topMostEventDispatcher.addEventListener(DragEvent.DRAG_END,
dragEndHandler);
@@ -145,7 +146,7 @@ package org.apache.flex.html.beads.controllers
             }
             else
             {
-                dragEvent = DragEvent.createDragEvent("dragOver", event);
+                dragEvent = DragEvent.createDragEvent("dragOver", event as MouseEvent);
                 dispatchEvent(dragEvent);
             }
         }
@@ -164,12 +165,15 @@ package org.apache.flex.html.beads.controllers
             IUIBase(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);		

         }
         
+		/**
+		 * @flexjsignorecoercion org.apache.flex.events.MouseEvent
+		 */
         private function dragEndHandler(event:DragEvent):void
         {
             trace("dragEnd");
             var dragEvent:DragEvent;
             
-            dragEvent = DragEvent.createDragEvent("dragDrop", event);
+            dragEvent = DragEvent.createDragEvent("dragDrop", event as MouseEvent);
             dispatchEvent(dragEvent);
             
             inside = false;


Mime
View raw message