Skip to content

Commit 6b34ae9

Browse files
committed
Position: Fix style issues
Closes jquerygh-1499
1 parent 62e0092 commit 6b34ae9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

ui/position.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//>>docs: http://api.jqueryui.com/position/
1616
//>>demos: http://jqueryui.com/position/
1717

18-
(function( factory ) {
18+
( function( factory ) {
1919
if ( typeof define === "function" && define.amd ) {
2020

2121
// AMD. Register as an anonymous module.
@@ -25,8 +25,8 @@
2525
// Browser globals
2626
factory( jQuery );
2727
}
28-
}(function( $ ) {
29-
(function() {
28+
}( function( $ ) {
29+
( function() {
3030

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

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

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

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

100100
if ( w1 === w2 ) {
101-
w2 = div[0].clientWidth;
101+
w2 = div[ 0 ].clientWidth;
102102
}
103103

104104
div.remove();
105105

106-
return (cachedScrollbarWidth = w1 - w2);
106+
return ( cachedScrollbarWidth = w1 - w2 );
107107
},
108108
getScrollInfo: function( within ) {
109109
var overflowX = within.isWindow || within.isDocument ? "" :
110110
within.element.css( "overflow-x" ),
111111
overflowY = within.isWindow || within.isDocument ? "" :
112112
within.element.css( "overflow-y" ),
113113
hasOverflowX = overflowX === "scroll" ||
114-
( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
114+
( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
115115
hasOverflowY = overflowY === "scroll" ||
116-
( overflowY === "auto" && within.height < within.element[0].scrollHeight );
116+
( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
117117
return {
118118
width: hasOverflowY ? $.position.scrollbarWidth() : 0,
119119
height: hasOverflowX ? $.position.scrollbarWidth() : 0
120120
};
121121
},
122122
getWithinInfo: function( element ) {
123123
var withinElement = $( element || window ),
124-
isWindow = $.isWindow( withinElement[0] ),
124+
isWindow = $.isWindow( withinElement[ 0 ] ),
125125
isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
126126
return {
127127
element: withinElement,
@@ -152,7 +152,7 @@ $.fn.position = function( options ) {
152152
offsets = {};
153153

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

172-
if ( pos.length === 1) {
172+
if ( pos.length === 1 ) {
173173
pos = rhorizontal.test( pos[ 0 ] ) ?
174174
pos.concat( [ "center" ] ) :
175175
rvertical.test( pos[ 0 ] ) ?
@@ -192,7 +192,7 @@ $.fn.position = function( options ) {
192192
rposition.exec( pos[ 0 ] )[ 0 ],
193193
rposition.exec( pos[ 1 ] )[ 0 ]
194194
];
195-
});
195+
} );
196196

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

218-
return this.each(function() {
218+
return this.each( function() {
219219
var collisionPosition, using,
220220
elem = $( this ),
221221
elemWidth = elem.outerWidth(),
@@ -268,9 +268,9 @@ $.fn.position = function( options ) {
268268
at: options.at,
269269
within: within,
270270
elem: elem
271-
});
271+
} );
272272
}
273-
});
273+
} );
274274

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

315315
elem.offset( $.extend( position, { using: using } ) );
316-
});
316+
} );
317317
};
318318

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

478478
// fraction support test
479-
(function() {
479+
( function() {
480480
var testElement, testElementParent, testElementStyle, offsetLeft, i,
481481
body = document.getElementsByTagName( "body" )[ 0 ],
482482
div = document.createElement( "div" );
@@ -496,7 +496,7 @@ $.ui.position = {
496496
position: "absolute",
497497
left: "-1000px",
498498
top: "-1000px"
499-
});
499+
} );
500500
}
501501
for ( i in testElementStyle ) {
502502
testElement.style[ i ] = testElementStyle[ i ];
@@ -512,10 +512,10 @@ $.ui.position = {
512512

513513
testElement.innerHTML = "";
514514
testElementParent.removeChild( testElement );
515-
})();
515+
} )();
516516

517-
})();
517+
} )();
518518

519519
return $.ui.position;
520520

521-
}));
521+
} ) );

0 commit comments

Comments
 (0)