No need to a placeholder if we can simply use "visibility" instead of
authorJan Schneider <jan@horde.org>
Thu, 10 Jun 2010 17:35:46 +0000 (19:35 +0200)
committerJan Schneider <jan@horde.org>
Thu, 10 Jun 2010 17:41:30 +0000 (19:41 +0200)
"display" for the original element. Also fixes a problem with positioning the
hidden element in IE.

horde/js/dragdrop2.js

index f80feab..1c5c40b 100644 (file)
@@ -358,8 +358,7 @@ Drag = Class.create({
                     }
                     this.ghost.setOpacity(0.7).setStyle({ zIndex: z + 1 });
                 } else {
-                    this.elthold = new Element('DIV').clonePosition(this.element);
-                    this.element.hide().insert({ before: this.elthold });
+                    this.element.setStyle({ visibility: 'hidden' });
                 }
 
                 // Insert ghost into the parent, either specified by a
@@ -439,8 +438,7 @@ Drag = Class.create({
 
         if (this.ghost) {
             if (!this.options.ghosting) {
-                this.elthold.remove();
-                this.element.show();
+                this.element.setStyle({ visibility: 'visible' });
             }
             this.ghost.remove();
             this.ghost = null;