]>
Commit | Line | Data |
---|---|---|
f0cfe83e AD |
1 | define("dijit/form/Textarea", [ |
2 | "dojo/_base/declare", // declare | |
3 | "dojo/dom-style", // domStyle.set | |
4 | "./_ExpandingTextAreaMixin", | |
5 | "./SimpleTextarea" | |
6 | ], function(declare, domStyle, _ExpandingTextAreaMixin, SimpleTextarea){ | |
7 | ||
8 | // module: | |
9 | // dijit/form/Textarea | |
10 | ||
11 | ||
12 | return declare("dijit.form.Textarea", [SimpleTextarea, _ExpandingTextAreaMixin], { | |
13 | // summary: | |
14 | // A textarea widget that adjusts it's height according to the amount of data. | |
15 | // | |
16 | // description: | |
17 | // A textarea that dynamically expands/contracts (changing it's height) as | |
18 | // the user types, to display all the text without requiring a scroll bar. | |
19 | // | |
20 | // Takes nearly all the parameters (name, value, etc.) that a vanilla textarea takes. | |
21 | // Rows is not supported since this widget adjusts the height. | |
22 | // | |
23 | // example: | |
24 | // | <textarea data-dojo-type="dijit/form/TextArea">...</textarea> | |
25 | ||
26 | ||
27 | // TODO: for 2.0, rename this to ExpandingTextArea, and rename SimpleTextarea to TextArea | |
28 | ||
29 | baseClass: "dijitTextBox dijitTextArea dijitExpandingTextArea", | |
30 | ||
31 | // Override SimpleTextArea.cols to default to width:100%, for backward compatibility | |
32 | cols: "", | |
33 | ||
34 | buildRendering: function(){ | |
35 | this.inherited(arguments); | |
36 | ||
37 | // tweak textarea style to reduce browser differences | |
38 | domStyle.set(this.textbox, { overflowY: 'hidden', overflowX: 'auto', boxSizing: 'border-box', MsBoxSizing: 'border-box', WebkitBoxSizing: 'border-box', MozBoxSizing: 'border-box' }); | |
39 | } | |
40 | }); | |
41 | ||
42 | }); |