diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-08 13:31:16 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-08 13:31:16 +0000 |
commit | 779523c7b5e6fde094856669ff374f2aad6967e7 (patch) | |
tree | 6bd8de10c0d0cb661af53a3b23fe2a93daf8ec75 /ui/ui.draggable.js | |
parent | 38a5b20fe77c742c57125e039aa70fe4e4a3677d (diff) | |
download | jquery-ui-779523c7b5e6fde094856669ff374f2aad6967e7.tar.gz jquery-ui-779523c7b5e6fde094856669ff374f2aad6967e7.zip |
draggable: fixed convertPositionTo (fixes #3710)
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 78f06e860..913e3dedb 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -284,20 +284,19 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { return { top: ( - pos.top // the calculated relative position - + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod - + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) + - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ), left: ( - pos.left // the calculated relative position - + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) * mod - + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) + - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod ) }; + }, _generatePosition: function(event) { @@ -339,9 +338,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { } - - - var position = { + return { top: ( pageY // The absolute mouse position - this.offset.click.top // Click offset (relative to the element) @@ -358,7 +355,6 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { ) }; - return position; }, _clear: function() { |