mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Build: Don't assume the browser environment; smoke test on Node w/ jsdom
Fixes gh-1950 Closes gh-1949
This commit is contained in:
committed by
Michał Gołębiowski
parent
ab20d9d24f
commit
76df9e4e38
@@ -1,6 +1,8 @@
|
||||
define([
|
||||
"./core",
|
||||
"./core/access",
|
||||
"./var/document",
|
||||
"./var/documentElement",
|
||||
"./css/var/rnumnonpx",
|
||||
"./css/curCSS",
|
||||
"./css/addGetHookIf",
|
||||
@@ -9,9 +11,7 @@ define([
|
||||
"./core/init",
|
||||
"./css",
|
||||
"./selector" // contains
|
||||
], function( jQuery, access, rnumnonpx, curCSS, addGetHookIf, support ) {
|
||||
|
||||
var docElem = window.document.documentElement;
|
||||
], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) {
|
||||
|
||||
/**
|
||||
* Gets a window from an element
|
||||
@@ -145,14 +145,14 @@ jQuery.fn.extend({
|
||||
|
||||
offsetParent: function() {
|
||||
return this.map(function() {
|
||||
var offsetParent = this.offsetParent || docElem;
|
||||
var offsetParent = this.offsetParent || documentElement;
|
||||
|
||||
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
|
||||
jQuery.css( offsetParent, "position" ) === "static" ) ) {
|
||||
offsetParent = offsetParent.offsetParent;
|
||||
}
|
||||
|
||||
return offsetParent || docElem;
|
||||
return offsetParent || documentElement;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user