Changeset 10541
- Timestamp:
- 09/17/07 20:49:19 (14 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
form/Textarea.js (modified) (1 diff)
-
_Widget.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/Textarea.js
r10527 r10541 9 9 dijit.form._FormWidget, 10 10 { 11 // TODO: set this up to work correctly 12 attributeMap: {}, 13 11 14 // summary 12 15 // A textarea that resizes vertically to contain the data. -
dijit/trunk/_Widget.js
r10532 r10541 108 108 this.buildRendering(); 109 109 110 // Copy attributes listed in attributeMap into the newly created DOM for the widget111 // The placement of these attributes is according to the property mapping in attributeMap 110 // Copy attributes listed in attributeMap into the [newly created] DOM for the widget. 111 // The placement of these attributes is according to the property mapping in attributeMap. 112 112 // Note special handling for 'style' and 'class' attributes which are lists and can 113 113 // have elements from both old and new structures, and some attributes like "type" 114 114 // cannot be processed this way as they are not mutable. 115 116 //KLUDGE: skip the widgets which aren't yet working. See #3058 117 if(!/dijit\.form\.(Slider|Textarea|ComboBox|FilteringSelect)/.test(this.declaredClass)) 118 119 for(var attr in this.attributeMap){ 120 if(this.domNode){ 115 if(this.domNode){ 116 for(var attr in this.attributeMap){ 121 117 var mapNode = this[this.attributeMap[attr] || "domNode"]; 122 118 var value = this[attr]; 123 119 if(value !== "" || (params && params[attr])){ 124 var domValue = mapNode.getAttribute(attr);125 // Deal with IE quirks for 'class' and 'style'126 120 switch(attr){ 127 121 case "class": 128 domValue = mapNode.className;122 mapNode.className += " " + value; 129 123 break; 130 124 case "style": 131 domValue = domValue && domValue.cssText; // FIXME: Opera 132 } 133 if(domValue){ 134 var delim = {style: ";", "class": " "}[attr]; 135 // style and class attributes are special and contain lists 136 // which need to be combined 137 if(delim && value){ 138 value += delim + domValue; 139 }else{ 140 value = domValue; 141 } 142 } 143 144 // Deal with IE quirks for 'class' and 'style' 145 switch(attr){ 146 case "class": 147 mapNode.className = value; 125 mapNode.style.cssText += "; " + value;// FIXME: Opera 148 126 break; 149 case "style":150 if(mapNode.style && dojo.isObject(mapNode.style)){151 mapNode.style.cssText = value; // required for IE, doesn't work in Opera152 break;153 }154 // fallthrough...155 127 default: 156 128 mapNode.setAttribute(attr, value);