Author: jmorliaguet
Date: Sat Jun 17 18:10:29 2006
New Revision: 3436

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
   cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js

Log:

- more robust drag-and-drop. the controller returns information about the
  destination container and the dropped element's order in the container.



Modified: cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    
(original)
+++ cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    Sat Jun 
17 18:10:29 2006
@@ -967,9 +967,10 @@
           } else {
             var target = s;
           }
-          s.parentNode.insertBefore(this.dragged, target);
+          var parent = s.parentNode;
+          parent.insertBefore(this.dragged, target);
+          this.droptarget = parent;
           shifted = true;
-          this.droptarget = target;
           return;
         };
       }.bind(this));
@@ -1029,7 +1030,8 @@
         var action_handler = CPSSkins.getAction(action_id);
         if (action_handler) action_handler({
           source: dragged,
-          target: this.droptarget || this.target,
+          target: this.droptarget,
+          order: 0,
           controller: this
         });
       }

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  Sat Jun 
17 18:10:29 2006
@@ -28,10 +28,11 @@
   var src_data = CPSSkins.getModelById('m' + src_id).getData();
   var dest_id = info.target.getAttribute('id');
   var dest_data = CPSSkins.getModelById('m' + dest_id).getData();
+  info.source.style.border = '1px solid red';
   var args = {
     src_id: src_data.id,
     dest_id: dest_data.id,
-    order: dest_data.order
+    order: info.order
   }
   var options = {
     parameters: $H(args).toQueryString(),
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to