diff options
author | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
---|---|---|
committer | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
commit | 58a2577d48790c79adfd44bcfd662c980ce6cfe4 (patch) | |
tree | 523d814ea0b7b6f617fe515b186099c6e83fed72 /lib/dijit/form/NumberSpinner.js.uncompressed.js | |
parent | e470a273cf09562fb2f9c0c899002303f19c8d16 (diff) | |
parent | cc332603431102a682feda22b9cf0093a29f0176 (diff) |
Merge branch 'master' of https://github.com/gothfox/Tiny-Tiny-RSS.git
Diffstat (limited to 'lib/dijit/form/NumberSpinner.js.uncompressed.js')
-rw-r--r-- | lib/dijit/form/NumberSpinner.js.uncompressed.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/dijit/form/NumberSpinner.js.uncompressed.js b/lib/dijit/form/NumberSpinner.js.uncompressed.js deleted file mode 100644 index 87b417f40..000000000 --- a/lib/dijit/form/NumberSpinner.js.uncompressed.js +++ /dev/null @@ -1,69 +0,0 @@ -define("dijit/form/NumberSpinner", [ - "dojo/_base/declare", // declare - "dojo/_base/event", // event.stop - "dojo/keys", // keys.END keys.HOME - "./_Spinner", - "./NumberTextBox" -], function(declare, event, keys, _Spinner, NumberTextBox){ - -// module: -// dijit/form/NumberSpinner - - -return declare("dijit.form.NumberSpinner", [_Spinner, NumberTextBox.Mixin], { - // 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 NumberSpinner({ constraints:{ max:300, min:100 }}, "someInput"); - - baseClass: "dijitTextBox dijitSpinner dijitNumberTextBox", - - 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 == keys.HOME || e.charOrCode == 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 == keys.HOME ? "min" : "max")]; - if(typeof value == "number"){ - this._setValueAttr(value, false); - } - // eat home or end key whether we change the value or not - event.stop(e); - } - } -}); - -}); |