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