diff options
author | Valerio Virgillito | 2012-06-17 22:31:44 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-17 22:31:44 -0700 |
commit | 8fe92b94ce5e1e2857d088752d94e19db7e3d8a8 (patch) | |
tree | d84807aae0b974b5200050972dd94da6066e363b /node_modules/montage/ui/range-input.reel | |
parent | e570fc8518cf03dd03c15982edcf17c5ba0a293d (diff) | |
download | ninja-8fe92b94ce5e1e2857d088752d94e19db7e3d8a8.tar.gz |
montage v11 merge into ninja
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/range-input.reel')
-rw-r--r-- | node_modules/montage/ui/range-input.reel/range-input.js | 83 |
1 files changed, 0 insertions, 83 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 deleted file mode 100644 index 2b4bfcf2..00000000 --- a/node_modules/montage/ui/range-input.reel/range-input.js +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<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. | ||
5 | </copyright> */ | ||
6 | /*global require,exports */ | ||
7 | |||
8 | /** | ||
9 | @module "montage/ui/range-input.reel" | ||
10 | @requires montage/ui/component | ||
11 | @requires montage/ui/text-input | ||
12 | @requires montage/ui/composer/press-composer | ||
13 | */ | ||
14 | |||
15 | var Montage = require("montage").Montage, | ||
16 | Component = require("ui/component").Component, | ||
17 | TextInput = require("ui/text-input").TextInput, | ||
18 | PressComposer = require("ui/composer/press-composer").PressComposer; | ||
19 | |||
20 | /** | ||
21 | * Wraps the a <input type="range"> element with binding support for the element's standard attributes. | ||
22 | @class module:"montage/ui/range-input.reel".RangeInput | ||
23 | @extends module:montage/text-input.TextInput | ||
24 | */ | ||
25 | var RangeInput = exports.RangeInput = Montage.create(TextInput, { | ||
26 | prepareForActivationEvents: { | ||
27 | value: function() { | ||
28 | var pressComposer = PressComposer.create(); | ||
29 | pressComposer.delegate = this; | ||
30 | this.addComposer(pressComposer); | ||
31 | pressComposer.addEventListener("pressStart", this, false); | ||
32 | pressComposer.addEventListener("press", this, false); | ||
33 | pressComposer.addEventListener("pressCancel", this, false); | ||
34 | } | ||
35 | }, | ||
36 | |||
37 | handlePressStart: { | ||
38 | value: function(e) { | ||
39 | var interactionStartEvent = document.createEvent("CustomEvent"); | ||
40 | interactionStartEvent.initCustomEvent("montage_range_interaction_start", true, true, null); | ||
41 | this.dispatchEvent(interactionStartEvent); | ||
42 | } | ||
43 | }, | ||
44 | |||
45 | handlePress: { | ||
46 | value: function(e) { | ||
47 | var interactionEndEvent = document.createEvent("CustomEvent"); | ||
48 | interactionEndEvent.initCustomEvent("montage_range_interaction_end", true, true, null); | ||
49 | this.dispatchEvent(interactionEndEvent); | ||
50 | } | ||
51 | }, | ||
52 | |||
53 | surrenderPointer: { | ||
54 | value: function(pointer, composer) { | ||
55 | // If the user is sliding us then we do not want anyone using | ||
56 | // the pointer | ||
57 | return false; | ||
58 | } | ||
59 | } | ||
60 | }); | ||
61 | |||
62 | RangeInput.addAttributes( /** @lends module:"montage/ui/range-input.reel".RangeInput# */ { | ||
63 | /** | ||
64 | The maximum value displayed but the input control. | ||
65 | @type {number} | ||
66 | @default null | ||
67 | */ | ||
68 | max: {dataType: 'number'}, | ||
69 | |||
70 | /** | ||
71 | The minimum value displayed but the input control. | ||
72 | @type {number} | ||
73 | @default null | ||
74 | */ | ||
75 | min: {dataType: 'number'}, | ||
76 | |||
77 | /** | ||
78 | The amount the number changes with each step. The step size can be a number, or the string 'any'. | ||
79 | @type {number|string} | ||
80 | @default null | ||
81 | */ | ||
82 | step: null // number or 'any' | ||
83 | }); | ||