Skip to content

Commit b6b4dd1

Browse files
arschmitzscottgonzalez
authored andcommitted
Slider: Fix line length issues
Ref gh-1690
1 parent e1f2318 commit b6b4dd1

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

ui/widgets/slider.js

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,12 @@ return $.widget( "ui.slider", $.ui.mouse, {
274274

275275
if ( this.orientation === "horizontal" ) {
276276
pixelTotal = this.elementSize.width;
277-
pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
277+
pixelMouse = position.x - this.elementOffset.left -
278+
( this._clickOffset ? this._clickOffset.left : 0 );
278279
} else {
279280
pixelTotal = this.elementSize.height;
280-
pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
281+
pixelMouse = position.y - this.elementOffset.top -
282+
( this._clickOffset ? this._clickOffset.top : 0 );
281283
}
282284

283285
percentMouse = ( pixelMouse / pixelTotal );
@@ -595,23 +597,38 @@ return $.widget( "ui.slider", $.ui.mouse, {
595597

596598
if ( this._hasMultipleValues() ) {
597599
this.handles.each( function( i ) {
598-
valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
600+
valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
601+
that._valueMin() ) * 100;
599602
_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
600603
$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
601604
if ( that.options.range === true ) {
602605
if ( that.orientation === "horizontal" ) {
603606
if ( i === 0 ) {
604-
that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
607+
that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
608+
left: valPercent + "%"
609+
}, o.animate );
605610
}
606611
if ( i === 1 ) {
607-
that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
612+
that.range[ animate ? "animate" : "css" ]( {
613+
width: ( valPercent - lastValPercent ) + "%"
614+
}, {
615+
queue: false,
616+
duration: o.animate
617+
} );
608618
}
609619
} else {
610620
if ( i === 0 ) {
611-
that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
621+
that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
622+
bottom: ( valPercent ) + "%"
623+
}, o.animate );
612624
}
613625
if ( i === 1 ) {
614-
that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
626+
that.range[ animate ? "animate" : "css" ]( {
627+
height: ( valPercent - lastValPercent ) + "%"
628+
}, {
629+
queue: false,
630+
duration: o.animate
631+
} );
615632
}
616633
}
617634
}
@@ -628,16 +645,24 @@ return $.widget( "ui.slider", $.ui.mouse, {
628645
this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
629646

630647
if ( oRange === "min" && this.orientation === "horizontal" ) {
631-
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
648+
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
649+
width: valPercent + "%"
650+
}, o.animate );
632651
}
633652
if ( oRange === "max" && this.orientation === "horizontal" ) {
634-
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, o.animate );
653+
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
654+
width: ( 100 - valPercent ) + "%"
655+
}, o.animate );
635656
}
636657
if ( oRange === "min" && this.orientation === "vertical" ) {
637-
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
658+
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
659+
height: valPercent + "%"
660+
}, o.animate );
638661
}
639662
if ( oRange === "max" && this.orientation === "vertical" ) {
640-
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, o.animate );
663+
this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
664+
height: ( 100 - valPercent ) + "%"
665+
}, o.animate );
641666
}
642667
}
643668
},

0 commit comments

Comments
 (0)