aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/textarea.reel/textarea.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-03 22:53:07 -0700
committerValerio Virgillito2012-05-03 22:53:07 -0700
commit24b483db367291b72170f969de78efcb1a9b95bd (patch)
treea691a7803cefbfa76a6331a50cbeebcd16287d91 /node_modules/montage/ui/textarea.reel/textarea.js
parentdc93269cfa7c315d22d85c8217e2412749643f28 (diff)
downloadninja-24b483db367291b72170f969de78efcb1a9b95bd.tar.gz
integrating the latest montage version
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.js94
1 files changed, 92 insertions, 2 deletions
diff --git a/node_modules/montage/ui/textarea.reel/textarea.js b/node_modules/montage/ui/textarea.reel/textarea.js
index 70d88660..4fa0d23e 100644
--- a/node_modules/montage/ui/textarea.reel/textarea.js
+++ b/node_modules/montage/ui/textarea.reel/textarea.js
@@ -4,12 +4,31 @@
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
7/**
8 @module "montage/ui/textarea.reel"
9 @requires montage/ui/component
10 @requires montage/ui/text-input
11*/
12
7var Montage = require("montage").Montage, 13var Montage = require("montage").Montage,
8Component = require("ui/component").Component, 14Component = require("ui/component").Component,
9TextInput = require("ui/text-input").TextInput; 15TextInput = require("ui/text-input").TextInput;
10 16
11var Textarea = exports.Textarea = Montage.create(TextInput, { 17/**
18 * Wraps the a &lt;textarea> element with binding support for the element's standard attributes. Uses an ArrayController instance to manage the element's contents and selection.
19 @class module:"montage/ui/textarea.reel".Textarea
20 @extends module:montage/text-input.TextInput
21 */
22
23var Textarea = exports.Textarea = Montage.create(TextInput, /** @lends module:"montage/ui/textarea.reel".Textarea# */ {
12 24
25 select: { value: function() { this._element.select(); } },
26
27/**
28 The text display by the Textarea component's element.
29 @type {string}
30 @default ""
31*/
13 textContent: { 32 textContent: {
14 get: function() { 33 get: function() {
15 return this.value; 34 return this.value;
@@ -21,17 +40,88 @@ var Textarea = exports.Textarea = Montage.create(TextInput, {
21 40
22}); 41});
23 42
24Textarea.addAttributes({ 43Textarea.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*/
25 autofocus: {dataType: 'boolean'}, 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*/
26 cols: null, 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*/
27 dirname: null, 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*/
28 disabled: {dataType: 'boolean'}, 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*/
29 form: null, 77 form: null,
78
79/**
80 The maximum allowed value length of the element.
81 @type {number}
82 @default null
83*/
30 maxlength: null, 84 maxlength: null,
85
86/**
87 The name associated with the textarea element.
88 @type {string}
89 @default null
90*/
31 name: null, 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*/
32 placeholder: null, 98 placeholder: null,
99
100/**
101 Specifies if this control is readonly.
102 @type {boolean}
103 @default false
104*/
33 readonly: {dataType: 'boolean'}, 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*/
34 required: {dataType: 'boolean'}, 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*/
35 rows: null, 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*/
36 wrap: null 126 wrap: null
37}); 127});