Author: jmorliaguet
Date: Fri Mar 10 20:46:20 2006
New Revision: 2572

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- optimizations

- drag-and-drop: fixed artefacts



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 Fri Mar 10 
20:46:20 2006
@@ -640,10 +640,11 @@
     }
     if (this.def.ghosting) {
       var clone = $(draggable.cloneNode(true));
-      clone.setStyle(
-        {'z-index': parseInt(draggable.getStyle('z-index') || 0) +1}
-      );
-      CPSSkins.Canvas.setOpacity(clone, 0.5);
+      clone.setStyle({
+        'z-index': parseInt(draggable.getStyle('z-index') || 0) +1,
+        'position': 'absolute'
+      });
+      CPSSkins.Canvas.setOpacity(clone, 0.8);
       draggable.parentNode.insertBefore(clone, draggable);
       this.moved = clone;
     } else {
@@ -661,7 +662,7 @@
   moveEvent: function(e) {
     var x = Event.pointerX(e);
     var y = Event.pointerY(e);
-    CPSSkins.Canvas.moveTo(this.moved,{'x': x-this.x1, 'y': y-this.y1});
+    CPSSkins.Canvas.moveTo(this.moved, {'x': x-this.x1, 'y': y-this.y1});
   },
 
   dropEvent: function(e) {
@@ -877,7 +878,6 @@
 
   moveTo: function(node, options) {
     node = $(node);
-    Position.absolutize(node);
     var x = options.x;
     var y = options.y;
     if (options.duration) {
@@ -886,8 +886,10 @@
       var y0 = pos[1];
       new CPSSkins.Scheduler(Object.extend(options, {
         action: function(value) {
-          node.style.left = x0 + (x - x0) * value + 'px';
-          node.style.top = y0 + (y - y0) * value + 'px';
+          node.setStyle({
+            'left': x0 + (x - x0) * value + 'px',
+            'top': y0 + (y - y0) * value + 'px'
+          });
         },
         onComplete: (options.onComplete || function() {}).bind(node)
       }));
@@ -898,7 +900,6 @@
 
   fitInsideScreen: function(node) {
     node = $(node);
-    Position.absolutize(node);
     var dimensions = node.getDimensions();
     var width = dimensions.width;
     var height = dimensions.height;
@@ -1577,11 +1578,12 @@
     if (this.effect) {
       this.effect.stop();
     }
+    var widget = this.widget;
     if (options.transition in CPSSkins.Effects) {
-      if (node.style.display == "none") {
-        node.style.display = "";
+      if (widget.style.display == "none") {
+        widget.style.display = "";
       }
-      this.effect = CPSSkins.Effects[options.transition](this.widget, options)
+      this.effect = CPSSkins.Effects[options.transition](widget, options)
     }
   }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to