Skip to content

Commit

Permalink
jQuery.fn.offset no longer returns ClientRect object for disconnected…
Browse files Browse the repository at this point in the history
… elements

Instead of returning box, which is a ClientRect, we take the top and left box
values and place them into a generic object.
  • Loading branch information
Russell Holbrook committed Nov 22, 2010
1 parent 0838bdf commit 50170e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {

// Make sure we're not dealing with a disconnected DOM node
if ( !box || !jQuery.contains( docElem, elem ) ) {
return box || { top: 0, left: 0 };
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
}

var body = doc.body,
Expand Down

1 comment on commit 50170e6

@russtacular
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit to fix jQuery ticket 7602 -- http://bugs.jquery.com/ticket/7602

Please sign in to comment.