Author: jmorliaguet
Date: Sun May 28 19:36:28 2006
New Revision: 3261

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
   cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py

Log:

- UI improvements (drag-and-drop)



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    Sun May 
28 19:36:28 2006
@@ -908,7 +908,13 @@
       });
       if (this.def.dragging.feedback.clone) {
         var clone = $(draggable.cloneNode(true));
-        clone.setStyle({margin: '0'});
+        clone.setStyle({
+          margin: '0',
+          borderColor: this.def.dragging.feedback.border || '#000',
+          backgroundColor: this.def.dragging.feedback.background || '#fff',
+          borderStyle: 'dashed',
+          borderWidth: '1px',
+        });
         feedback.appendChild(clone);
       } else {
         feedback.setStyle({
@@ -929,11 +935,9 @@
     this.dragged = draggable;
     this.dragged.setOpacity(this.def.dragging.opacity || 0.8);
 
-    this.moved.setStyle({position: 'absolute'});
+    this.moved.setStyle({position: 'absolute', cursor: 'move'});
     this.moved.moveTo({x: x-this.x1, y: y-this.y1});
 
-    this.moved.setStyle({cursor: 'move'});
-
     if (this.def.dropping) {
       var highlight = this.def.dropping.highlight;
       if (highlight && this._dropzones) {
@@ -967,7 +971,7 @@
     moved.moveTo({x: x-this.x1, y: y-this.y1, fit: true});
 
     var now = new Date().getTime();
-    if (now < this._last_updated + 100) return;
+    if (now < this._last_updated + 50) return;
     this._last_updated = now;
 
     var shifting = this.def.shifting;
@@ -1083,8 +1087,11 @@
       moved.parentNode.removeChild(moved);
     }
 
+    if (this.def.dragging.opacity && this.dragged) {
+      this.dragged.setOpacity(1);
+    }
+
     if (moved) moved.setStyle({cursor: ''});
-    if (dragged) dragged.setOpacity(1);
     this.dragged = null;
   }
 

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       Sun May 
28 19:36:28 2006
@@ -559,7 +559,10 @@
             'offset_x': -5,
             'offset_y': -5,
             'feedback': {
-                'opacity': 0.7,
+                'opacity': 1,
+                'clone': False,
+                'background': '#fc0',
+                'border': '#000',
             },
             'zoomback': {
                 'duration': 300,
@@ -580,9 +583,11 @@
         'type': 'drag-and-drop',
         'dragging': {
             'source': 'elementMovable',
+            'opacity': 0.2,
             'feedback': {
-                'opacity': 0.7,
+                'opacity': 0.93,
                 'clone': True,
+                'border': '#000',
             },
         },
         'shifting': {
@@ -591,6 +596,9 @@
         },
         'dropping': {
             'action': 'move element',
+            'zoomto': {
+                'duration': 200,
+            }
         },
     },
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to