Skip to content
Permalink
Browse files

Position: Fix style issues

Closes gh-1499
  • Loading branch information
jzaefferer committed Mar 18, 2015
1 parent 62e0092 commit 6b34ae952b06a84d81d284f3b005369b5690225b
Showing with 22 additions and 22 deletions.
  1. +22 −22 ui/position.js
@@ -15,7 +15,7 @@
//>>docs: http://api.jqueryui.com/position/
//>>demos: http://jqueryui.com/position/

(function( factory ) {
( function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
@@ -25,8 +25,8 @@
// Browser globals
factory( jQuery );
}
}(function( $ ) {
(function() {
}( function( $ ) {
( function() {

$.ui = $.ui || {};

@@ -53,7 +53,7 @@ function parseCss( element, property ) {
}

function getDimensions( elem ) {
var raw = elem[0];
var raw = elem[ 0 ];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
@@ -89,7 +89,7 @@ $.position = {
}
var w1, w2,
div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
innerDiv = div.children()[0];
innerDiv = div.children()[ 0 ];

$( "body" ).append( div );
w1 = innerDiv.offsetWidth;
@@ -98,30 +98,30 @@ $.position = {
w2 = innerDiv.offsetWidth;

if ( w1 === w2 ) {
w2 = div[0].clientWidth;
w2 = div[ 0 ].clientWidth;
}

div.remove();

return (cachedScrollbarWidth = w1 - w2);
return ( cachedScrollbarWidth = w1 - w2 );
},
getScrollInfo: function( within ) {
var overflowX = within.isWindow || within.isDocument ? "" :
within.element.css( "overflow-x" ),
overflowY = within.isWindow || within.isDocument ? "" :
within.element.css( "overflow-y" ),
hasOverflowX = overflowX === "scroll" ||
( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
hasOverflowY = overflowY === "scroll" ||
( overflowY === "auto" && within.height < within.element[0].scrollHeight );
( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
return {
width: hasOverflowY ? $.position.scrollbarWidth() : 0,
height: hasOverflowX ? $.position.scrollbarWidth() : 0
};
},
getWithinInfo: function( element ) {
var withinElement = $( element || window ),
isWindow = $.isWindow( withinElement[0] ),
isWindow = $.isWindow( withinElement[ 0 ] ),
isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
return {
element: withinElement,
@@ -152,7 +152,7 @@ $.fn.position = function( options ) {
offsets = {};

dimensions = getDimensions( target );
if ( target[0].preventDefault ) {
if ( target[ 0 ].preventDefault ) {
// force left top to allow flipping
options.at = "left top";
}
@@ -169,7 +169,7 @@ $.fn.position = function( options ) {
horizontalOffset,
verticalOffset;

if ( pos.length === 1) {
if ( pos.length === 1 ) {
pos = rhorizontal.test( pos[ 0 ] ) ?
pos.concat( [ "center" ] ) :
rvertical.test( pos[ 0 ] ) ?
@@ -192,7 +192,7 @@ $.fn.position = function( options ) {
rposition.exec( pos[ 0 ] )[ 0 ],
rposition.exec( pos[ 1 ] )[ 0 ]
];
});
} );

// normalize collision option
if ( collision.length === 1 ) {
@@ -215,7 +215,7 @@ $.fn.position = function( options ) {
basePosition.left += atOffset[ 0 ];
basePosition.top += atOffset[ 1 ];

return this.each(function() {
return this.each( function() {
var collisionPosition, using,
elem = $( this ),
elemWidth = elem.outerWidth(),
@@ -268,9 +268,9 @@ $.fn.position = function( options ) {
at: options.at,
within: within,
elem: elem
});
} );
}
});
} );

if ( options.using ) {
// adds feedback as second argument to using callback, if present
@@ -313,7 +313,7 @@ $.fn.position = function( options ) {
}

elem.offset( $.extend( position, { using: using } ) );
});
} );
};

$.ui.position = {
@@ -476,7 +476,7 @@ $.ui.position = {
};

// fraction support test
(function() {
( function() {
var testElement, testElementParent, testElementStyle, offsetLeft, i,
body = document.getElementsByTagName( "body" )[ 0 ],
div = document.createElement( "div" );
@@ -496,7 +496,7 @@ $.ui.position = {
position: "absolute",
left: "-1000px",
top: "-1000px"
});
} );
}
for ( i in testElementStyle ) {
testElement.style[ i ] = testElementStyle[ i ];
@@ -512,10 +512,10 @@ $.ui.position = {

testElement.innerHTML = "";
testElementParent.removeChild( testElement );
})();
} )();

})();
} )();

return $.ui.position;

}));
} ) );

0 comments on commit 6b34ae9

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