| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/dom-construct", |
| 4 |
"dijit/form/_CheckBoxMixin", |
| 5 |
"./ToggleButton", |
| 6 |
"./sniff" |
| 7 |
], |
| 8 |
function(declare, domConstruct, CheckBoxMixin, ToggleButton, has){ |
| 9 |
|
| 10 |
return declare("dojox.mobile.CheckBox", [ToggleButton, CheckBoxMixin], { |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
baseClass: "mblCheckBox", |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
_setTypeAttr: function(){}, |
| 22 |
|
| 23 |
buildRendering: function(){ |
| 24 |
if(!this.templateString && !this.srcNodeRef){ |
| 25 |
|
| 26 |
|
| 27 |
this.srcNodeRef = domConstruct.create("input", {type: this.type}); |
| 28 |
} |
| 29 |
this.inherited(arguments); |
| 30 |
if(!this.templateString){ |
| 31 |
|
| 32 |
this.focusNode = this.domNode; |
| 33 |
} |
| 34 |
|
| 35 |
if(has("windows-theme")){ |
| 36 |
var rootNode = domConstruct.create("span", {className: "mblCheckableInputContainer"}); |
| 37 |
rootNode.appendChild(this.domNode.cloneNode()); |
| 38 |
this.labelNode = domConstruct.create("span", {className: "mblCheckableInputDecorator"}, rootNode); |
| 39 |
this.domNode = rootNode; |
| 40 |
this.focusNode = rootNode.firstChild; |
| 41 |
} |
| 42 |
}, |
| 43 |
|
| 44 |
_getValueAttr: function(){ |
| 45 |
|
| 46 |
|
| 47 |
return (this.checked ? this.value : false); |
| 48 |
} |
| 49 |
}); |
| 50 |
}); |