mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 03:35:16 -05:00
Build: update grunt-jscs-checker and pass with the new rules
Conflicts: build/tasks/build.js src/ajax/xhr.js src/attributes/classes.js src/attributes/prop.js src/attributes/val.js src/core/init.js src/core/ready.js src/css.js src/css/curCSS.js src/css/defaultDisplay.js src/data.js src/data/var/dataPriv.js src/data/var/dataUser.js src/dimensions.js src/effects.js src/event.js src/manipulation.js src/offset.js src/queue.js src/selector-native.js test/data/testrunner.js
This commit is contained in:
@@ -46,7 +46,8 @@ jQuery.offset = {
|
||||
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
|
||||
jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
|
||||
|
||||
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
||||
// need to be able to calculate position if either top or left
|
||||
// is auto and position is either absolute or fixed
|
||||
if ( calculatePosition ) {
|
||||
curPosition = curElem.position();
|
||||
curTop = curPosition.top;
|
||||
@@ -122,7 +123,8 @@ jQuery.fn.extend({
|
||||
parentOffset = { top: 0, left: 0 },
|
||||
elem = this[ 0 ];
|
||||
|
||||
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
|
||||
// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
|
||||
// because it is its only offset parent
|
||||
if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
||||
// we assume that getBoundingClientRect is available when computed position is fixed
|
||||
offset = elem.getBoundingClientRect();
|
||||
@@ -154,7 +156,8 @@ jQuery.fn.extend({
|
||||
return this.map(function() {
|
||||
var offsetParent = this.offsetParent || docElem;
|
||||
|
||||
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
|
||||
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
|
||||
jQuery.css( offsetParent, "position" ) === "static" ) ) {
|
||||
offsetParent = offsetParent.offsetParent;
|
||||
}
|
||||
return offsetParent || docElem;
|
||||
|
||||
Reference in New Issue
Block a user