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 3c0378a commit fa2ccd1e46c71179d6f1c7104c29ef90d7ceb2e0
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 fa2ccd1

Please sign in to comment.