Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Slider: value on button not updated
Browse files Browse the repository at this point in the history
Closes gh-7289
Fixes gh-7137
  • Loading branch information
cgack authored and Gabriel Schulhof committed Apr 10, 2014
1 parent 3c0378a commit fa2ccd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/widgets/forms/slider.tooltip.js
Expand Up @@ -93,7 +93,9 @@ $.widget( "mobile.slider", $.mobile.slider, {
if ( o.popupEnabled && this._popup ) {
this._positionPopup();
this._popup.html( newValue );
} else if ( o.showValue && !this.options.mini ) {
}

if ( o.showValue && !this.options.mini ) {
this.handle.html( newValue );
}
},
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/slider/index.html
Expand Up @@ -124,6 +124,10 @@
<input type="range" name="tooltip-test" id="tooltip-test" value="17" min="0" max="100" data-nstest-popup-enabled="true"/>
</label>

<label>Tooltip w/ Button value:
<input type="range" name="tooltip-test-both" id="tooltip-test-both" value="17" min="0" max="100" data-nstest-popup-enabled="true" data-nstest-show-value="true"/>
</label>

</div>

<div id="enhancetest">
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/slider/slider_core.js
Expand Up @@ -105,4 +105,13 @@
});
slider.trigger( "mouseup" );
});

test( "slider tooltip & button values should match after input value changes", function() {
var slider = $("#tooltip-test-both");
var sliderHandle = slider.siblings(".ui-slider-track").children(".ui-slider-handle");

slider.val( "9" ).blur();

ok( slider.val() === sliderHandle.text(), "slider text should match handle text");
});
})( jQuery );

0 comments on commit fa2ccd1

Please sign in to comment.