Skip to content

Commit de4cbda

Browse files
arschmitzscottgonzalez
authored andcommitted
Position: Fix line length issues
Ref jquerygh-1690
1 parent 9dd2576 commit de4cbda

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

ui/position.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ $.position = {
105105
return cachedScrollbarWidth;
106106
}
107107
var w1, w2,
108-
div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
108+
div = $( "<div " +
109+
"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
110+
"<div style='height:100px;width:auto;'></div></div>" ),
109111
innerDiv = div.children()[ 0 ];
110112

111113
$( "body" ).append( div );
@@ -242,8 +244,10 @@ $.fn.position = function( options ) {
242244
elemHeight = elem.outerHeight(),
243245
marginLeft = parseCss( this, "marginLeft" ),
244246
marginTop = parseCss( this, "marginTop" ),
245-
collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
246-
collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
247+
collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
248+
scrollInfo.width,
249+
collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
250+
scrollInfo.height,
247251
position = $.extend( {}, basePosition ),
248252
myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
249253

@@ -353,7 +357,8 @@ $.ui.position = {
353357

354358
// Element is initially over the left side of within
355359
if ( overLeft > 0 && overRight <= 0 ) {
356-
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
360+
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
361+
withinOffset;
357362
position.left += overLeft - newOverRight;
358363

359364
// Element is initially over right side of within
@@ -396,7 +401,8 @@ $.ui.position = {
396401

397402
// Element is initially over the top of within
398403
if ( overTop > 0 && overBottom <= 0 ) {
399-
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
404+
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
405+
withinOffset;
400406
position.top += overTop - newOverBottom;
401407

402408
// Element is initially over bottom of within
@@ -450,12 +456,14 @@ $.ui.position = {
450456
newOverLeft;
451457

452458
if ( overLeft < 0 ) {
453-
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
459+
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
460+
outerWidth - withinOffset;
454461
if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
455462
position.left += myOffset + atOffset + offset;
456463
}
457464
} else if ( overRight > 0 ) {
458-
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
465+
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
466+
atOffset + offset - offsetLeft;
459467
if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
460468
position.left += myOffset + atOffset + offset;
461469
}
@@ -484,12 +492,14 @@ $.ui.position = {
484492
newOverTop,
485493
newOverBottom;
486494
if ( overTop < 0 ) {
487-
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
495+
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
496+
outerHeight - withinOffset;
488497
if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
489498
position.top += myOffset + atOffset + offset;
490499
}
491500
} else if ( overBottom > 0 ) {
492-
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
501+
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
502+
offset - offsetTop;
493503
if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
494504
position.top += myOffset + atOffset + offset;
495505
}

0 commit comments

Comments
 (0)