From: Richard D. Worth Date: Fri, 23 Apr 2010 20:13:06 +0000 (-0400) Subject: Revert "Draggable: Don't use computed style for top and left of position:relative... X-Git-Tag: 1.9m1~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=670ab819a9a6388393e2c1a73c1eaf7095bdc6e0;p=jquery-ui.git Revert "Draggable: Don't use computed style for top and left of position:relative elements. Fixes #5537 - Draggable: position relative draggable jumps on first drag in Opera" This reverts commit dc94bbf53628ada1b5d8e7da909f63bfe10f25ff. --- diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index ba8a419f6..9496ce3f5 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -305,8 +305,8 @@ $.widget("ui.draggable", $.ui.mouse, { if(this.cssPosition == "relative") { var p = this.element.position(); return { - top: p.top - (parseInt(this.helper[0].style.top,10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper[0].style.left,10) || 0) + this.scrollParent.scrollLeft() + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() }; } else { return { top: 0, left: 0 };