| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dijit/_WidgetBase" |
| 4 |
], function(declare, _WidgetBase){ |
| 5 |
return declare("dojox.mvc.Element", _WidgetBase, { |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
_setInnerTextAttr: {node: "domNode", type: "innerText"}, |
| 12 |
_setInnerHTMLAttr: {node: "domNode", type: "innerHTML"}, |
| 13 |
|
| 14 |
buildRendering: function(){ |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
this.inherited(arguments); |
| 19 |
if(/select|input|textarea/i.test(this.domNode.tagName)){ |
| 20 |
var _self = this, node = this.focusNode = this.domNode; |
| 21 |
this.on("change", function(e){ |
| 22 |
var attr = /^checkbox$/i.test(node.getAttribute("type")) ? "checked" : "value"; |
| 23 |
_self._set(attr, _self.get(attr)); |
| 24 |
}); |
| 25 |
} |
| 26 |
}, |
| 27 |
|
| 28 |
_getCheckedAttr: function(){ return this.domNode.checked; }, |
| 29 |
_getValueAttr: function(){ return this.domNode.value; } |
| 30 |
}); |
| 31 |
}); |