Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
1005 bytes
|
Line | |
---|
1 | define([ |
---|
2 | "dojo/_base/declare", |
---|
3 | "dojo/dom-construct", |
---|
4 | "dijit/form/_CheckBoxMixin", |
---|
5 | "./ToggleButton" |
---|
6 | ], |
---|
7 | function(declare, domConstruct, CheckBoxMixin, ToggleButton){ |
---|
8 | |
---|
9 | /*===== |
---|
10 | ToggleButton = dojox.mobile.ToggleButton; |
---|
11 | CheckBoxMixin = dijit.form._CheckBoxMixin; |
---|
12 | =====*/ |
---|
13 | return declare("dojox.mobile.CheckBox", [ToggleButton, CheckBoxMixin], { |
---|
14 | // summary: |
---|
15 | // A non-templated checkbox widget that can be in two states (checked or not). |
---|
16 | |
---|
17 | baseClass: "mblCheckBox", |
---|
18 | |
---|
19 | _setTypeAttr: function(){}, // cannot be changed: IE complains w/o this |
---|
20 | |
---|
21 | buildRendering: function(){ |
---|
22 | if(!this.srcNodeRef){ |
---|
23 | // The following doesn't work on IE < 8 if the default state is checked. |
---|
24 | // You have to use "<input checked>" instead but it's not worth the bytes here. |
---|
25 | this.srcNodeRef = domConstruct.create("input", {type: this.type}); |
---|
26 | } |
---|
27 | this.inherited(arguments); |
---|
28 | this.focusNode = this.domNode; |
---|
29 | }, |
---|
30 | |
---|
31 | _getValueAttr: function(){ |
---|
32 | return (this.checked ? this.value : false); |
---|
33 | } |
---|
34 | }); |
---|
35 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.