]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/js/dojo/openils/widget/Textarea.js
LP2045292 Color contrast for AngularJS patron bills
[working/Evergreen.git] / Open-ILS / web / js / dojo / openils / widget / Textarea.js
1 if(!dojo._hasResource['openils.widget.Textarea']) {
2     dojo.provide('openils.widget.Textarea');
3     dojo.require("dijit.form._FormWidget");
4
5    /**
6      * Simple textarea that honors spaces/tabs
7      */
8
9     dojo.declare(
10         'openils.widget.Textarea', dijit.form._FormValueWidget,
11         {
12             width : '',
13             height : '',
14             templateString : '<textarea class="openils-widget-textarea" value="${value}" dojoAttachPoint="formValueNode,editNode,focusNode,styleNode"></textarea>',
15             
16             constructor : function(args) {
17                 if(!args) args = {};
18                 this.width = args.width || openils.widget.Textarea.width;
19                 this.height = args.height || openils.widget.Textarea.height;
20             },
21             
22             postCreate : function() {
23                 if(this.width)
24                     dojo.style(this.domNode, 'width', this.width);
25                 if(this.height)
26                     dojo.style(this.domNode, 'height', this.height);
27             },
28
29             attr : function(name, val) {
30                 if(name == 'value') {
31                     if(val)
32                         this.domNode.value = val;
33                     return this.domNode.value;
34                 } else {
35                     return this.inherited(arguments);
36                 }
37             }
38         }
39     );
40 }
41