Skip to content
Permalink
Browse files

draggable: pageX/pageY already do not include scroll offsets in safar…

…i, therefore it does not need to be substracted again (fixes #4142) (only if css position is fixed) (removed redundant check)
  • Loading branch information...
Paul Bakaus
Paul Bakaus committed Feb 13, 2009
1 parent 5030b57 commit 39d164b95e79b4b1e56fe889b95bcce505fe857a
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/ui.draggable.js
@@ -356,14 +356,14 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
- this.offset.click.top // Click offset (relative to the element)
- this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' && !$.browser.safari ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
),
left: (
pageX // The absolute mouse position
- this.offset.click.left // Click offset (relative to the element)
- this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' && !$.browser.safari ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
)
};

0 comments on commit 39d164b

Please sign in to comment.
You can’t perform that action at this time.