source: Dev/branches/rest-dojo-ui/client/dijit/form/Textarea.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

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