Permalink
Browse files

Slider: Initially hide the tooltip

Fixes gh-7020
  • Loading branch information...
gabrielschulhof committed Jan 30, 2014
1 parent 277d379 commit 044a3f89a1474bea8314868a0e5e4c627d9c9541
Showing with 14 additions and 1 deletion.
  1. +1 −0 js/widgets/forms/slider.tooltip.js
  2. +6 −1 tests/unit/slider/index.html
  3. +7 −0 tests/unit/slider/slider_core.js
@@ -61,6 +61,7 @@ $.widget( "mobile.slider", $.mobile.slider, {
if ( value && !this._popup ) {
this._popup = getPopup()
.addClass( "ui-body-" + ( this.options.theme || "a" ) )
.hide()
.insertBefore( this.element );
}
}
@@ -14,7 +14,8 @@
<script>
$.testHelper.asyncLoad([
[
"widgets/forms/slider"
"widgets/forms/slider",
"widgets/forms/slider.tooltip"
],
[
"slider_events.js",
@@ -119,6 +120,10 @@
<input type="range" name="disable-test" id="disable-test" value="17" min="0" max="100"/>
</label>
<label>Tooltip slider:
<input type="range" name="tooltip-test" id="tooltip-test" value="17" min="0" max="100" data-nstest-popup-enabled="true"/>
</label>
</div>
<div id="enhancetest">
@@ -67,6 +67,13 @@
ok( ! $( "#textinput-test" ).parents().is( "div.ui-input-text" ), "slider input is not wrapped in div.ui-input-text" );
});
test( "slider tooltip", function() {
var tooltip = $( "#tooltip-test" ).siblings( "div.ui-slider-popup" );
deepEqual( tooltip.length, 1, "is present" );
deepEqual( tooltip.is( ":visible" ), false, "is initially hidden" );
});
test( "slider is enabled/disabled correctly", function() {
var slider = $( "#disable-test" ),
track = slider.siblings( "div" );

0 comments on commit 044a3f8

Please sign in to comment.