diff options
author | Armen Kesablyan | 2012-02-15 14:28:21 -0800 |
---|---|---|
committer | Armen Kesablyan | 2012-02-15 14:28:21 -0800 |
commit | 2a5484af59544a9dfdda854d707455f08a24fe69 (patch) | |
tree | 31055dd7a5548ab307a094d02be7012c77eeb4b9 /node_modules/montage/ui/range-input.reel/range-input.js | |
parent | bb4da39a73cbd6fbe83f3b7c9ed5ae60fe58dd6b (diff) | |
download | ninja-2a5484af59544a9dfdda854d707455f08a24fe69.tar.gz |
Latest Montage Updates 0.6 Fixes
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/range-input.reel/range-input.js')
-rw-r--r-- | node_modules/montage/ui/range-input.reel/range-input.js | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/node_modules/montage/ui/range-input.reel/range-input.js b/node_modules/montage/ui/range-input.reel/range-input.js index 0c247603..e97c2de9 100644 --- a/node_modules/montage/ui/range-input.reel/range-input.js +++ b/node_modules/montage/ui/range-input.reel/range-input.js | |||
@@ -3,22 +3,54 @@ | |||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | /*global require,exports */ | ||
6 | var Montage = require("montage").Montage, | 7 | var Montage = require("montage").Montage, |
7 | Component = require("ui/component").Component, | 8 | Component = require("ui/component").Component, |
8 | TextInput = require("ui/text-input").TextInput; | 9 | TextInput = require("ui/text-input").TextInput, |
10 | PressComposer = require("ui/composer/press-composer").PressComposer; | ||
11 | |||
9 | /** | 12 | /** |
10 | * The input type="range" field | 13 | * The input type="range" field |
11 | */ | 14 | */ |
12 | var RangeInput = exports.RangeInput = Montage.create(TextInput, { | 15 | var RangeInput = exports.RangeInput = Montage.create(TextInput, { |
16 | prepareForActivationEvents: { | ||
17 | value: function() { | ||
18 | var pressComposer = PressComposer.create(); | ||
19 | pressComposer.delegate = this; | ||
20 | this.addComposer(pressComposer); | ||
21 | pressComposer.addEventListener("pressstart", this, false); | ||
22 | pressComposer.addEventListener("press", this, false); | ||
23 | pressComposer.addEventListener("presscancel", this, false); | ||
24 | } | ||
25 | }, | ||
26 | |||
27 | handlePressstart: { | ||
28 | value: function(e) { | ||
29 | var interactionStartEvent = document.createEvent("CustomEvent"); | ||
30 | interactionStartEvent.initCustomEvent("montage_range_interaction_start", true, true, null); | ||
31 | this.dispatchEvent(interactionStartEvent); | ||
32 | } | ||
33 | }, | ||
34 | |||
35 | handlePress: { | ||
36 | value: function(e) { | ||
37 | var interactionEndEvent = document.createEvent("CustomEvent"); | ||
38 | interactionEndEvent.initCustomEvent("montage_range_interaction_end", true, true, null); | ||
39 | this.dispatchEvent(interactionEndEvent); | ||
40 | } | ||
41 | }, | ||
13 | 42 | ||
43 | surrenderPointer: { | ||
44 | value: function(pointer, composer) { | ||
45 | // If the user is sliding us then we do not want anyone using | ||
46 | // the pointer | ||
47 | return false; | ||
48 | } | ||
49 | } | ||
14 | }); | 50 | }); |
15 | 51 | ||
16 | RangeInput.addAttributes({ | 52 | RangeInput.addAttributes({ |
17 | disabled: {dataType: 'boolean'}, | 53 | max: {dataType: 'number'}, |
18 | max: null, | 54 | min: {dataType: 'number'}, |
19 | min: null, | 55 | step: null // number or 'any' |
20 | name: null, | ||
21 | readonly: {dataType: 'boolean'}, | ||
22 | required: {dataType: 'boolean'}, | ||
23 | step: null | ||
24 | }); | 56 | }); |