diff options
author | Armen Kesablyan | 2012-06-19 00:45:26 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-19 00:45:26 -0700 |
commit | c59eb371559a3061ce53223e249ca97daace5968 (patch) | |
tree | f9540e26c0f273d35f92010605da65dd85bbe70c /node_modules/montage/ui/text-input.js | |
parent | 0f040acabfb7a4bf3138debec5aff869487ceb11 (diff) | |
parent | 918a4f5870e972b6e4e301c3237e065a1ffd26f5 (diff) | |
download | ninja-c59eb371559a3061ce53223e249ca97daace5968.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'node_modules/montage/ui/text-input.js')
-rw-r--r-- | node_modules/montage/ui/text-input.js | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/node_modules/montage/ui/text-input.js b/node_modules/montage/ui/text-input.js index ef8beb5d..483a8126 100644 --- a/node_modules/montage/ui/text-input.js +++ b/node_modules/montage/ui/text-input.js | |||
@@ -42,27 +42,25 @@ var TextInput = exports.TextInput = Montage.create(NativeControl, /** @lends mo | |||
42 | value: false | 42 | value: false |
43 | }, | 43 | }, |
44 | 44 | ||
45 | /** | 45 | /** |
46 | The "typed" data value associated with the input element. When this property is set, if the component's <code>converter</code> property is non-null then its <code>revert()</code> method is invoked, passing it the newly assigned value. The <code>revert()</code> function is responsible for validating and converting the user-supplied value to its typed format. For example, in the case of a DateInput component (which extends TextInput) a user enters a string for the date (for example, "10-12-2005"). A <code>DateConverter</code> object is assigned to the component's <code>converter</code> property. | 46 | The "typed" data value associated with the input element. When this property is set, if the component's <code>converter</code> property is non-null then its <code>revert()</code> method is invoked, passing it the newly assigned value. The <code>revert()</code> function is responsible for validating and converting the user-supplied value to its typed format. For example, in the case of a DateInput component (which extends TextInput) a user enters a string for the date (for example, "10-12-2005"). A <code>DateConverter</code> object is assigned to the component's <code>converter</code> property. |
47 | 47 | ||
48 | If the comopnent doesn't specify a converter object then the raw value is assigned to <code>value</code>. | 48 | If the comopnent doesn't specify a converter object then the raw value is assigned to <code>value</code>. |
49 | 49 | ||
50 | @type {string} | 50 | @type {string} |
51 | @default null | 51 | @default null |
52 | */ | 52 | */ |
53 | value: { | 53 | value: { |
54 | enumerable: true, | 54 | get: function() { |
55 | serializable: true, | 55 | return this._value; |
56 | get: function() { | 56 | }, |
57 | return this._value; | 57 | set: function(value, fromInput) { |
58 | }, | ||
59 | set: function(value, fromInput) { | ||
60 | 58 | ||
61 | if(value !== this._value) { | 59 | if(value !== this._value) { |
62 | if(this.converter) { | 60 | if(this.converter) { |
63 | var convertedValue; | 61 | var convertedValue; |
64 | try { | 62 | try { |
65 | convertedValue = this.converter.revert(value); | 63 | convertedValue = this.converter.revert(value); |
66 | if (this.error) { | 64 | if (this.error) { |
67 | this.error = null; | 65 | this.error = null; |
68 | } | 66 | } |
@@ -86,7 +84,8 @@ value: { | |||
86 | this.needsDraw = true; | 84 | this.needsDraw = true; |
87 | } | 85 | } |
88 | } | 86 | } |
89 | } | 87 | }, |
88 | serializable: true | ||
90 | }, | 89 | }, |
91 | 90 | ||
92 | // set value from user input | 91 | // set value from user input |
@@ -107,7 +106,8 @@ value: { | |||
107 | @see {@link module:montage/core/converter.Converter} | 106 | @see {@link module:montage/core/converter.Converter} |
108 | */ | 107 | */ |
109 | converter:{ | 108 | converter:{ |
110 | value: null | 109 | value: null, |
110 | serializable: true | ||
111 | }, | 111 | }, |
112 | 112 | ||
113 | _error: { | 113 | _error: { |
@@ -162,7 +162,8 @@ value: { | |||
162 | }, | 162 | }, |
163 | set: function(v) { | 163 | set: function(v) { |
164 | this._updateOnInput = v; | 164 | this._updateOnInput = v; |
165 | } | 165 | }, |
166 | serializable: true | ||
166 | }, | 167 | }, |
167 | 168 | ||
168 | // HTMLInputElement methods | 169 | // HTMLInputElement methods |