Skip to content
Permalink
Browse files

spinner: added support for numeric keypad

  • Loading branch information
Ca-Phun Ung
Ca-Phun Ung committed Aug 21, 2008
1 parent 732c7fb commit 57ed1acc45280c7475c359f29718ae554fe5b7b1
Showing with 5 additions and 1 deletion.
  1. +5 −1 ui/ui.spinner.js
@@ -181,6 +181,8 @@ $.widget('ui.spinner', {
if(e.keyCode == KEYS.END && this.options.max != undefined) this._setValue(this.options.max); //End key goes to maximum
return (e.keyCode == KEYS.TAB || e.keyCode == KEYS.BACKSPACE ||
e.keyCode == KEYS.LEFT || e.keyCode == KEYS.RIGHT || e.keyCode == KEYS.PERIOD ||
e.keyCode == KEYS.NUMPAD_DECIMAL || e.keyCode == KEYS.NUMPAD_SUBTRACT ||
(e.keyCode >= 96 && e.keyCode <= 105) || // add support for numeric keypad 0-9
(/[0-9\-\.]/).test(String.fromCharCode(e.keyCode))) ? true : false;
},
_mousewheel: function(e, delta) {
@@ -293,7 +295,9 @@ $.extend($.ui.spinner, {
DOWN: 40,
DEL: 46,
COMMA: 188,
PERIOD: 190
PERIOD: 190,
NUMPAD_DECIMAL: 110,
NUMPAD_SUBTRACT: 109
}
});

0 comments on commit 57ed1ac

Please sign in to comment.
You can’t perform that action at this time.