});
test( "orientation", function() {
- expect( 6 );
+ expect( 8 );
element = $( "#slider1" );
options = {
element.slider( options ).slider( "option", "orientation", "horizontal" );
ok( element.is( ".ui-slider-horizontal" ), "horizontal slider has class .ui-slider-horizontal" );
ok( !element.is( ".ui-slider-vertical" ), "horizontal slider does not have class .ui-slider-vertical" );
+ equal( element.find( ".ui-slider-handle" )[ 0 ].style.bottom, "", "CSS bottom reset" );
equal( handle()[0].style.left, percentVal + "%", "horizontal slider handle is positioned with left: %" );
element.slider( "destroy" ) ;
element.slider( options ).slider( "option", "orientation", "vertical" );
ok( element.is( ".ui-slider-vertical" ), "vertical slider has class .ui-slider-vertical" );
ok( !element.is( ".ui-slider-horizontal" ), "vertical slider does not have class .ui-slider-horizontal" );
+ equal( element.find( ".ui-slider-handle" )[ 0 ].style.left, "", "CSS left reset" );
equal( handle()[0].style.bottom, percentVal + "%", "vertical slider handle is positioned with bottom: %" );
element.slider( "destroy" );
.removeClass( "ui-slider-horizontal ui-slider-vertical" )
.addClass( "ui-slider-" + this.orientation );
this._refreshValue();
+
+ // Reset positioning from previous orientation
+ this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
break;
case "value":
this._animateOff = true;