Permalink
Browse files

Rangeslider: Fire change when handles meet

Fixes gh-8159
Closes gh-8162
  • Loading branch information...
cgack authored and arschmitz committed Jun 25, 2015
1 parent 9247127 commit 93c599364fa52df43db3d51526c37b87b13021af
@@ -236,7 +236,7 @@
this._updateHighlight();
if ( min >= max ) {
if ( min > max ) {
return false;
}
},
@@ -73,7 +73,11 @@
<div data-nstest-role="rangeslider" id="nocorners-rangeslider" data-nstest-mini="true">
<input name="range-nocorners-first" id="range-nocorners-first" min="0" max="100" value="0" type="range">
<input name="range-nocorners-last" id="range-nocorners-last" min="0" max="100" value="100" type="range">
</div>
</div>
<div id="change-proximity-rangeslider" data-nstest-role="rangeslider">
<input name="rangeslider-first" id="rangeslider-proximity-first" min="1" max="2" value="1" type="range">
<input name="rangeslider-last" id="rangeslider-proximity-last" min="1" max="2" value="2" type="range">
</div>
</form>
</div>
@@ -64,6 +64,10 @@
<input name="range-disabled-first" id="range-disabled-first" min="0" max="100" value="0" type="range">
<input name="range-disabled-last" id="range-disabled-last" min="0" max="100" value="100" type="range">
</div>
<div id="change-proximity-rangeslider" data-nstest-role="rangeslider">
<input name="rangeslider-first" id="rangeslider-proximity-first" min="1" max="2" value="1" type="range">
<input name="rangeslider-last" id="rangeslider-proximity-last" min="1" max="2" value="2" type="range">
</div>
</form>
</div>
@@ -138,4 +138,17 @@
assert.lacksClasses( sliderLast, "ui-state-disabled" );
} );
test( "moving slider handles to same spot fires change event", function() {
var rangeslider = $( "#change-proximity-rangeslider" ),
handleFirst = rangeslider.find( ".ui-slider-handle" ).first(),
sliderFirst = $( "#rangeslider-proximity-first" );
$( sliderFirst ).on( "change", function() {
equal( 2, $( this ).val(), "values should be equal on change when handles meet" );
} );
$.Event.prototype.keyCode = $.mobile.keyCode[ "UP" ];
handleFirst.trigger( "keydown" );
} );
} )( jQuery );

0 comments on commit 93c5993

Please sign in to comment.