aboutsummaryrefslogtreecommitdiff
path: root/js/components/ui/input-group.reel/input-group.js
diff options
context:
space:
mode:
authorPierre Frisch2011-12-22 07:25:50 -0800
committerValerio Virgillito2012-01-27 11:18:17 -0800
commitb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch)
tree0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/components/ui/input-group.reel/input-group.js
parent2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff)
downloadninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/components/ui/input-group.reel/input-group.js')
-rw-r--r--js/components/ui/input-group.reel/input-group.js85
1 files changed, 85 insertions, 0 deletions
diff --git a/js/components/ui/input-group.reel/input-group.js b/js/components/ui/input-group.reel/input-group.js
new file mode 100644
index 00000000..456a146c
--- /dev/null
+++ b/js/components/ui/input-group.reel/input-group.js
@@ -0,0 +1,85 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10var InputGroup = exports.InputGroup = Montage.create(Component, {
11
12 forwardEvent:
13 {
14 value: function(event)
15 {
16 if(event.type === "propertyChanging")
17 {
18 this._handlePropertyChanging(event);
19 }
20 else
21 {
22 this._handlePropertyChange(event);
23 }
24 }
25 },
26
27 _handlePropertyChanging:
28 {
29 value: function(event)
30 {
31 this._dispatchPropEvent(event);
32 }
33 },
34
35 _handlePropertyChange:
36 {
37 value: function(event)
38 {
39 this._dispatchPropEvent(event);
40 }
41 },
42
43 _dispatchPropEvent: {
44 value: function(event) {
45 var propEvent = document.createEvent("CustomEvent");
46 if(event.type === "propertyChanging")
47 {
48 propEvent.initEvent("changing", true, true);
49 propEvent.type = "changing";
50 }
51 else
52 {
53 propEvent.initEvent("change", true, true);
54 propEvent.type = "change";
55 }
56 propEvent.propertyLabel = event.propertyLabel;
57 propEvent.propertyValue = event.propertyValue;
58 propEvent.propertyEvent = event;
59
60 this.dispatchEvent(propEvent);
61 }
62 },
63
64 value: {
65 enumerable: true,
66 serializable: true,
67 get: function () {
68 var retObject = {};
69 for(var i=0, len=this.controlsList.childComponents.length; i< len; i++)
70 {
71 var childControl = this.controlsList.childComponents[i];
72 retObject[childControl.label] = childControl._control[childControl._prop];
73 }
74 return retObject;
75
76 }
77 },
78
79 controlsList: {
80 enumerable: true,
81 serializable: true,
82 value: null
83 }
84
85});