Slider: trim value to min and max when page_up or page_down is pressed. Fixed #5591 - Slider: can go below its defined minimum with PageDown

This commit is contained in:
Richard D. Worth 2010-05-11 07:31:48 -04:00
parent b53b48b618
commit b7c0823da6

View File

@ -181,10 +181,10 @@ $.widget( "ui.slider", $.ui.mouse, {
newVal = self._valueMax();
break;
case $.ui.keyCode.PAGE_UP:
newVal = curVal + ( (self._valueMax() - self._valueMin()) / numPages );
newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
break;
case $.ui.keyCode.PAGE_DOWN:
newVal = curVal - ( (self._valueMax() - self._valueMin()) / numPages );
newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
break;
case $.ui.keyCode.UP:
case $.ui.keyCode.RIGHT: