From 6b34ae952b06a84d81d284f3b005369b5690225b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Sat, 14 Mar 2015 12:33:03 +0100 Subject: [PATCH] Position: Fix style issues Closes gh-1499 --- ui/position.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ui/position.js b/ui/position.js index 1ef4d4c5b..7423d02d1 100644 --- a/ui/position.js +++ b/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 = $( "
" ), - innerDiv = div.children()[0]; + innerDiv = div.children()[ 0 ]; $( "body" ).append( div ); w1 = innerDiv.offsetWidth; @@ -98,12 +98,12 @@ $.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 ? "" : @@ -111,9 +111,9 @@ $.position = { 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 @@ -121,7 +121,7 @@ $.position = { }, 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; -})); +} ) ); -- 2.39.5