diff options
author | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:18 +0400 |
commit | 1354d17270961fff662d40f90521223f8fd0d73b (patch) | |
tree | e9266be71587e47c800303446e968a6d3565e2cf /lib/dijit/form/NumberSpinner.js | |
parent | d04f8c826f5283765f52cf6b98b42a1ed8f2d6bc (diff) |
update dojo to 1.7.3
Diffstat (limited to 'lib/dijit/form/NumberSpinner.js')
-rw-r--r-- | lib/dijit/form/NumberSpinner.js | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/lib/dijit/form/NumberSpinner.js b/lib/dijit/form/NumberSpinner.js index ba5a782f5..1f7dc1640 100644 --- a/lib/dijit/form/NumberSpinner.js +++ b/lib/dijit/form/NumberSpinner.js @@ -1,71 +1,2 @@ -/* - Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dijit.form.NumberSpinner"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dijit.form.NumberSpinner"] = true; -dojo.provide("dijit.form.NumberSpinner"); -dojo.require("dijit.form._Spinner"); -dojo.require("dijit.form.NumberTextBox"); - - -dojo.declare("dijit.form.NumberSpinner", - [dijit.form._Spinner, dijit.form.NumberTextBoxMixin], - { - // summary: - // Extends NumberTextBox to add up/down arrows and pageup/pagedown for incremental change to the value - // - // description: - // A `dijit.form.NumberTextBox` extension to provide keyboard accessible value selection - // as well as icons for spinning direction. When using the keyboard, the typematic rules - // apply, meaning holding the key will gradually increase or decrease the value and - // accelerate. - // - // example: - // | new dijit.form.NumberSpinner({ constraints:{ max:300, min:100 }}, "someInput"); - - adjust: function(/*Object*/ val, /*Number*/ delta){ - // summary: - // Change Number val by the given amount - // tags: - // protected - - var tc = this.constraints, - v = isNaN(val), - gotMax = !isNaN(tc.max), - gotMin = !isNaN(tc.min) - ; - if(v && delta != 0){ // blank or invalid value and they want to spin, so create defaults - val = (delta > 0) ? - gotMin ? tc.min : gotMax ? tc.max : 0 : - gotMax ? this.constraints.max : gotMin ? tc.min : 0 - ; - } - var newval = val + delta; - if(v || isNaN(newval)){ return val; } - if(gotMax && (newval > tc.max)){ - newval = tc.max; - } - if(gotMin && (newval < tc.min)){ - newval = tc.min; - } - return newval; - }, - - _onKeyPress: function(e){ - if((e.charOrCode == dojo.keys.HOME || e.charOrCode == dojo.keys.END) && !(e.ctrlKey || e.altKey || e.metaKey) - && typeof this.get('value') != 'undefined' /* gibberish, so HOME and END are default editing keys*/){ - var value = this.constraints[(e.charOrCode == dojo.keys.HOME ? "min" : "max")]; - if(typeof value == "number"){ - this._setValueAttr(value, false); - } - // eat home or end key whether we change the value or not - dojo.stopEvent(e); - } - } -}); - -} +//>>built +define("dijit/form/NumberSpinner",["dojo/_base/declare","dojo/_base/event","dojo/keys","./_Spinner","./NumberTextBox"],function(_1,_2,_3,_4,_5){return _1("dijit.form.NumberSpinner",[_4,_5.Mixin],{adjust:function(_6,_7){var tc=this.constraints,v=isNaN(_6),_8=!isNaN(tc.max),_9=!isNaN(tc.min);if(v&&_7!=0){_6=(_7>0)?_9?tc.min:_8?tc.max:0:_8?this.constraints.max:_9?tc.min:0;}var _a=_6+_7;if(v||isNaN(_a)){return _6;}if(_8&&(_a>tc.max)){_a=tc.max;}if(_9&&(_a<tc.min)){_a=tc.min;}return _a;},_onKeyPress:function(e){if((e.charOrCode==_3.HOME||e.charOrCode==_3.END)&&!(e.ctrlKey||e.altKey||e.metaKey)&&typeof this.get("value")!="undefined"){var _b=this.constraints[(e.charOrCode==_3.HOME?"min":"max")];if(typeof _b=="number"){this._setValueAttr(_b,false);}_2.stop(e);}}});});
\ No newline at end of file |