Author: jmorliaguet
Date: Mon Apr 10 11:27:58 2006
New Revision: 2803

Modified:
   cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html
Log:

- some DnD fixes



Modified: cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      Mon Apr 
10 11:27:58 2006
@@ -415,7 +415,7 @@
         'id': 'portlet-factory',
         'type': 'drag-and-drop',
         'dragging': {
-            'source': ['factory'],
+            'source': 'factory',
             'offset_x': -5,
             'offset_y': -5,
             'feedback': {
@@ -423,10 +423,10 @@
             },
             'zoomback': {
                 'duration': 300,
-            }
+            },
         },
         'dropping': {
-            'target': ['portletTarget'],
+            'target': 'portletTarget',
             'highlight': {
                 'duration': 800,
             },
@@ -437,7 +437,7 @@
         'id': 'element-mover',
         'type': 'drag-and-drop',
         'dragging': {
-            'source': ['elementMovable'],
+            'source': 'elementMovable',
             'feedback': {
                 'opacity': 0.3,
             },

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Mon Apr 10 
11:27:58 2006
@@ -712,16 +712,16 @@
     if (shifting) {
       if (shifting.element) {
         this._shiftablezones = document.getElementsByClassName(
-                               shifting.element, widget)
+                               shifting.element)
       }
       if (shifting.container) {
         this._containerzones = document.getElementsByClassName(
-                               shifting.container, widget)
+                               shifting.container)
       }
     }
     if (this.def.dropping) {
       this._dropzones = document.getElementsByClassName(
-                        this.def.dropping.target, widget)
+                        this.def.dropping.target)
     }
 
     var dragEvent = this.dragEvent.bindAsEventListener(
@@ -907,8 +907,9 @@
     var y = Event.pointerY(e);
 
     var inTarget = false;
+    var dropzones = this._dropzones;
     if (this.def.dropping) {
-      this._dropzones.each(function(d) {
+      dropzones.each(function(d) {
         if (Position.within(d, x, y)) {
           inTarget = true;
           this.target = d;

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html
        (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html
        Mon Apr 10 11:27:58 2006
@@ -77,7 +77,6 @@
   <ins class="controller">
   {"id": "dnd",
    "type": "drag-and-drop",
-   "action": "displayInfo",
    "dragging": {
      "source": "dragdrop",
      "feedback": {
@@ -91,7 +90,8 @@
    "dropping": {
      "target": "drop",
      "highlight": {
-       "duration": 300
+       "duration": 300,
+       "action": "displayInfo"
      }
   }}
   </ins>
@@ -99,7 +99,6 @@
   <ins class="controller">
   {"id": "dnd2",
    "type": "drag-and-drop",
-   "action": "displayInfo",
    "dragging": {
      "source": "dragthis",
      "feedback": {
@@ -111,19 +110,22 @@
    "shifting": {
      "element": "block",
      "container": "container"
+   },
+   "dropping": {
+     "action": "displayInfo"
   }}
   </ins>
 
   <ins class="controller">
   {"id": "dnd3",
    "type": "drag-and-drop",
-   "action": "displayInfo",
    "dragging": {
      "source": "movethis",
      "opacity": 0.6
    },
    "dropping": {
      "target": "drophere",
+     "action": "displayInfo",
      "highlight": {
        "duration": 800
      }
@@ -133,7 +135,6 @@
   <ins class="controller">
   {"id": "dnd4",
    "type": "drag-and-drop",
-   "action": "displayInfo",
    "dragging": {
      "source": "block",
      "feedback": {
@@ -147,6 +148,7 @@
      "container": "container"
    },
    "dropping": {
+     "action": "displayInfo",
      "zoomto": {
        "duration": 200
      }
@@ -157,7 +159,6 @@
   <ins class="controller">
   {"id": "dnd5",
    "type": "drag-and-drop",
-   "action": "displayInfo",
    "dragging": {
      "source": "factory",
      "feedback": {
@@ -169,6 +170,7 @@
    },
    "dropping": {
      "target": "drophere",
+     "action": "displayInfo",
      "highlight": {
        "duration": 600
      }
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to