Ticket #6396: 6396.patch
| File 6396.patch, 3.8 kB (added by becky, 6 months ago) |
|---|
-
Users/bgibson/Documents/workspace/trunk/dijit/form/_Spinner.js
43 43 this._setStateClass(); 44 44 }, 45 45 46 _arrowPressed: function(/*Node*/ nodePressed, /*Number*/ direction ){46 _arrowPressed: function(/*Node*/ nodePressed, /*Number*/ direction, /*Number*/ increment){ 47 47 if(this.disabled || this.readOnly){ return; } 48 48 this._arrowState(nodePressed, true); 49 this.setValue(this.adjust(this.getValue(), direction* this.smallDelta), false);49 this.setValue(this.adjust(this.getValue(), direction*increment), false); 50 50 dijit.selectInputText(this.textbox, this.textbox.value.length); 51 51 }, 52 52 … … 57 57 }, 58 58 59 59 _typematicCallback: function(/*Number*/ count, /*DOMNode*/ node, /*Event*/ evt){ 60 if(node == this.textbox){ node = (evt.charOrCode == dojo.keys.UP_ARROW) ? this.upArrowNode : this.downArrowNode; } 60 var inc=this.smallDelta; 61 k=dojo.keys; 62 if(node == this.textbox){ 63 switch(evt.charOrCode){ 64 case k.PAGE_UP: 65 node=this.upArrowNode; 66 inc = this.largeDelta; 67 break; 68 case k.PAGE_DOWN: 69 node=this.downArrowNode; 70 inc = this.largeDelta; 71 break; 72 case k.UP_ARROW: 73 node=this.upArrowNode; 74 break; 75 default: //k.DOWN_ARROW: 76 node=this.downArrowNode; 77 } 78 } 61 79 if(count == -1){ this._arrowReleased(node); } 62 else{ this._arrowPressed(node, (node == this.upArrowNode) ? 1 : -1 ); }80 else{ this._arrowPressed(node, (node == this.upArrowNode) ? 1 : -1, inc); } 63 81 }, 64 82 65 83 _wheelTimer: null, … … 73 91 var node = this[(scrollAmount > 0 ? "upArrowNode" : "downArrowNode" )]; 74 92 var dir = (scrollAmount > 0 ? 1 : -1); 75 93 76 this._arrowPressed(node, dir );94 this._arrowPressed(node, dir, this.smallDelta); 77 95 78 96 if(!this._wheelTimer){ 79 97 clearTimeout(this._wheelTimer); … … 90 108 this.connect(this.domNode, !dojo.isMozilla ? "onmousewheel" : 'DOMMouseScroll', "_mouseWheeled"); 91 109 this._connects.push(dijit.typematic.addListener(this.upArrowNode, this.textbox, {charOrCode:dojo.keys.UP_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_typematicCallback", this.timeoutChangeRate, this.defaultTimeout)); 92 110 this._connects.push(dijit.typematic.addListener(this.downArrowNode, this.textbox, {charOrCode:dojo.keys.DOWN_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_typematicCallback", this.timeoutChangeRate, this.defaultTimeout)); 111 this._connects.push(dijit.typematic.addListener(this.upArrowNode, this.textbox, {charOrCode:dojo.keys.PAGE_UP,ctrlKey:false,altKey:false,shiftKey:false}, this, "_typematicCallback", this.timeoutChangeRate, this.defaultTimeout)); 112 this._connects.push(dijit.typematic.addListener(this.downArrowNode, this.textbox, {charOrCode:dojo.keys.PAGE_DOWN,ctrlKey:false,altKey:false,shiftKey:false}, this, "_typematicCallback", this.timeoutChangeRate, this.defaultTimeout)); 93 113 if(dojo.isIE){ 94 114 var _this = this; 95 115 this.connect(this.domNode, "onresize", -
Users/bgibson/Documents/workspace/trunk/dijit/form/NumberSpinner.js
8 8 [dijit.form._Spinner, dijit.form.NumberTextBoxMixin], 9 9 { 10 10 // summary: 11 // extends NumberTextBox to add up/down arrows for incremental change to the value11 // extends NumberTextBox to add up/down arrows and pageup/pagedown for incremental change to the value 12 12 13 13 required: true, 14 14