Permalink
Browse files

Slider: value on button not updated

Closes gh-7289
Fixes gh-7137
  • Loading branch information...
cgack authored and gabrielschulhof committed Apr 1, 2014
1 parent db17abf commit 8c8d149fef88a0c42c4215d88bd5753ec1e32bf7
Showing with 16 additions and 1 deletion.
  1. +3 −1 js/widgets/forms/slider.tooltip.js
  2. +4 −0 tests/unit/slider/index.html
  3. +9 −0 tests/unit/slider/slider_core.js
@@ -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 );
}
},
@@ -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">
@@ -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 8c8d149

Please sign in to comment.