Slider: Style updates

Ref #14246
This commit is contained in:
Alexander Schmitz 2015-08-24 08:58:09 -04:00
parent 62c8217185
commit e583a512d7
6 changed files with 185 additions and 181 deletions

View File

@ -75,12 +75,14 @@ test( "value", function() {
var element = $( "<div></div>" ).slider( { var element = $( "<div></div>" ).slider( {
min: -1, value: 0, max: 1 min: -1, value: 0, max: 1
} ); } );
// min with value option vs value method // min with value option vs value method
element.slider( "option", "value", -2 ); element.slider( "option", "value", -2 );
equal( element.slider( "option", "value" ), -2, "value option does not respect min" ); equal( element.slider( "option", "value" ), -2, "value option does not respect min" );
equal( element.slider( "value" ), -1, "value method get respects min" ); equal( element.slider( "value" ), -1, "value method get respects min" );
equal( element.slider( "value", -2 ), element, "value method is chainable" ); equal( element.slider( "value", -2 ), element, "value method is chainable" );
equal( element.slider( "option", "value" ), -1, "value method set respects min" ); equal( element.slider( "option", "value" ), -1, "value method set respects min" );
// max with value option vs value method // max with value option vs value method
element.slider( "option", "value", 2 ); element.slider( "option", "value", 2 );
equal( element.slider( "option", "value" ), 2, "value option does not respect max" ); equal( element.slider( "option", "value" ), 2, "value option does not respect max" );

View File

@ -361,6 +361,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
_change: function( event, index ) { _change: function( event, index ) {
if ( !this._keySliding && !this._mouseSliding ) { if ( !this._keySliding && !this._mouseSliding ) {
//store the last changed value index for reference when handles overlap //store the last changed value index for reference when handles overlap
this._lastChangedValue = index; this._lastChangedValue = index;
this._trigger( "change", event, this._uiHash( index ) ); this._trigger( "change", event, this._uiHash( index ) );
@ -503,6 +504,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
return val; return val;
} else if ( this._hasMultipleValues() ) { } else if ( this._hasMultipleValues() ) {
// .slice() creates a copy of the array // .slice() creates a copy of the array
// this copy gets trimmed by min and max and then returned // this copy gets trimmed by min and max and then returned
vals = this.options.values.slice(); vals = this.options.values.slice();