Textarea.js.uncompressed.js 1.4 KB

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