git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0838bdf
)
jQuery.fn.offset no longer returns ClientRect object for disconnected elements
author
Russell Holbrook
<russell.holbrook@patch.com>
Mon, 22 Nov 2010 23:26:46 +0000
(18:26 -0500)
committer
Russell Holbrook
<russell.holbrook@patch.com>
Mon, 22 Nov 2010 23:26:46 +0000
(18:26 -0500)
Instead of returning box, which is a ClientRect, we take the top and left box
values and place them into a generic object.
src/offset.js
patch
|
blob
|
history
diff --git
a/src/offset.js
b/src/offset.js
index
3fb2917
..
dab053e
100644
(file)
--- a/
src/offset.js
+++ b/
src/offset.js
@@
-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 ) ) {
// 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,
}
var body = doc.body,