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

Commit

Permalink
Merge 3286892 into 7b818d8
Browse files Browse the repository at this point in the history
  • Loading branch information
cgack committed May 29, 2014
2 parents 7b818d8 + 3286892 commit f397eb1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/widgets/forms/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ $.widget( "mobile.slider", $.extend( {
this.slider
.toggleClass( "ui-state-disabled", value )
.attr( "aria-disabled", value );

this.element.toggleClass( "ui-state-disabled", value );
}

}, $.mobile.behaviors.formReset ) );
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/slider/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
<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>

<label>Input slider:
<input type="range" name="disable-input-test" id="disable-input-test" value="17" min="0" max="100"/>
</label>

</div>

<div id="enhancetest">
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/slider/slider_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@

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

test( "slider input is disabled correctly", function() {
var slider = $( "#disable-input-test" );

slider.slider( "disable" );

ok( slider.hasClass( "ui-state-disabled" ), "disabling slider also disables the input " );
});

})( jQuery );

0 comments on commit f397eb1

Please sign in to comment.