From: Jan Schneider Date: Tue, 20 Apr 2010 16:47:45 +0000 (+0200) Subject: Use Element.Layout to calculate the ghost size. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=23730923a6acb469dabf682f73c3bfc81b41d986;p=horde.git Use Element.Layout to calculate the ghost size. --- diff --git a/horde/js/dragdrop2.js b/horde/js/dragdrop2.js index 7a83fa56c..37385395d 100644 --- a/horde/js/dragdrop2.js +++ b/horde/js/dragdrop2.js @@ -324,7 +324,12 @@ Drag = Class.create({ if (!this.ghost) { // Create the "ghost", i.e. the moving element, a clone of the // original element, if it doesn't exist yet. - this.ghost = $(this.element.cloneNode(true)).writeAttribute('id', null).addClassName(this.options.classname).clonePosition(this.element, { setHeight: false, setWidth: false }).setStyle({ height: this.element.clientHeight + 'px', position: 'absolute', width: this.element.clientWidth + 'px' }); + var layout = this.element.getLayout(); + this.ghost = $(this.element.cloneNode(true)) + .writeAttribute('id', null) + .addClassName(this.options.classname) + .clonePosition(this.element, { setHeight: false, setWidth: false }) + .setStyle({ position: 'absolute', height: layout.get('height') + 'px', width: layout.get('width') + 'px' }); // eo is the offset of the original element to the body. eo = this.element.cumulativeOffset();