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/textarea.reel/textarea.js | |
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/textarea.reel/textarea.js')
-rw-r--r-- | node_modules/montage/ui/textarea.reel/textarea.js | 125 |
1 files changed, 11 insertions, 114 deletions
diff --git a/node_modules/montage/ui/textarea.reel/textarea.js b/node_modules/montage/ui/textarea.reel/textarea.js index 4fa0d23e..bb0b6570 100644 --- a/node_modules/montage/ui/textarea.reel/textarea.js +++ b/node_modules/montage/ui/textarea.reel/textarea.js | |||
@@ -3,125 +3,22 @@ | |||
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 | 6 | /*global require,exports */ | |
7 | /** | ||
8 | @module "montage/ui/textarea.reel" | ||
9 | @requires montage/ui/component | ||
10 | @requires montage/ui/text-input | ||
11 | */ | ||
12 | |||
13 | var Montage = require("montage").Montage, | 7 | var Montage = require("montage").Montage, |
14 | Component = require("ui/component").Component, | 8 | Component = require("ui/component").Component, |
15 | TextInput = require("ui/text-input").TextInput; | 9 | NativeTextarea = require("ui/native/textarea.reel").Textarea; |
16 | 10 | ||
17 | /** | 11 | /** |
18 | * Wraps the a <textarea> element with binding support for the element's standard attributes. Uses an ArrayController instance to manage the element's contents and selection. | 12 | * Textarea |
19 | @class module:"montage/ui/textarea.reel".Textarea | ||
20 | @extends module:montage/text-input.TextInput | ||
21 | */ | 13 | */ |
14 | exports.Textarea = Montage.create(NativeTextarea, { | ||
22 | 15 | ||
23 | var Textarea = exports.Textarea = Montage.create(TextInput, /** @lends module:"montage/ui/textarea.reel".Textarea# */ { | 16 | hasTemplate: {value: true}, |
24 | |||
25 | select: { value: function() { this._element.select(); } }, | ||
26 | 17 | ||
27 | /** | 18 | didSetElement: { |
28 | The text display by the Textarea component's element. | 19 | value: function() { |
29 | @type {string} | 20 | NativeTextarea.didSetElement.call(this); |
30 | @default "" | 21 | this['class'] = (this['class'] || '') + ' montage-textarea'; |
31 | */ | ||
32 | textContent: { | ||
33 | get: function() { | ||
34 | return this.value; | ||
35 | }, | ||
36 | set: function(v) { | ||
37 | this.value = v; | ||
38 | } | 22 | } |
39 | } | 23 | } |
40 | 24 | }); \ No newline at end of file | |
41 | }); | ||
42 | |||
43 | Textarea.addAttributes( /** @lends module:"montage/ui/textarea.reel".Textarea# */ { | ||
44 | /** | ||
45 | Specifies whether the element should be focused as soon as the page is loaded. | ||
46 | @type {boolean} | ||
47 | @default false | ||
48 | */ | ||
49 | autofocus: {dataType: 'boolean'}, | ||
50 | |||
51 | /** | ||
52 | The maximum number of characters per line of text to display. | ||
53 | @type {number} | ||
54 | @default null | ||
55 | */ | ||
56 | cols: null, | ||
57 | |||
58 | /** | ||
59 | The name of the field that contains that value that specifies the element's directionality. | ||
60 | @type {string} | ||
61 | @default null | ||
62 | */ | ||
63 | dirname: null, | ||
64 | |||
65 | /** | ||
66 | When true, the textarea element is disabled to user input, and "disabled" is added to the element's CSS class list. | ||
67 | @type {boolean} | ||
68 | @default false | ||
69 | */ | ||
70 | disabled: {dataType: 'boolean'}, | ||
71 | |||
72 | /** | ||
73 | The value of the <code>id</code> attribute of the form with which to associate the component's element. | ||
74 | @type string} | ||
75 | @default null | ||
76 | */ | ||
77 | form: null, | ||
78 | |||
79 | /** | ||
80 | The maximum allowed value length of the element. | ||
81 | @type {number} | ||
82 | @default null | ||
83 | */ | ||
84 | maxlength: null, | ||
85 | |||
86 | /** | ||
87 | The name associated with the textarea element. | ||
88 | @type {string} | ||
89 | @default null | ||
90 | */ | ||
91 | name: null, | ||
92 | |||
93 | /** | ||
94 | Placeholder text to display in the textarea before the user has entered any text. | ||
95 | @type {string} | ||
96 | @default null | ||
97 | */ | ||
98 | placeholder: null, | ||
99 | |||
100 | /** | ||
101 | Specifies if this control is readonly. | ||
102 | @type {boolean} | ||
103 | @default false | ||
104 | */ | ||
105 | readonly: {dataType: 'boolean'}, | ||
106 | |||
107 | /** | ||
108 | When true, the user will be required to enter a value in the textarea before submitting the form. | ||
109 | @type {string} | ||
110 | @default false | ||
111 | */ | ||
112 | required: {dataType: 'boolean'}, | ||
113 | |||
114 | /** | ||
115 | The number of lines of text the browser should render for the textarea. | ||
116 | @type {number} | ||
117 | @default null | ||
118 | */ | ||
119 | rows: null, | ||
120 | |||
121 | /** | ||
122 | If the value of this property is "hard", the browser will insert line breaks such that each line of user input has no more characters than the value specified by the <code>cols</code> property. If the value is "soft" then no line breaks will be added. | ||
123 | @type {string} | ||
124 | @default | ||
125 | */ | ||
126 | wrap: null | ||
127 | }); | ||