Debian Codegraph @

dojox/mobile/ToggleButton.js

raw symbols SCIP
1 define([
2 "dojo/_base/declare",
3 "dojo/dom-class",
4 "dijit/form/_ToggleButtonMixin",
5 "./Button"
6 ], function(declare, domClass, ToggleButtonMixin, Button){
7
8 return declare("dojox.mobile.ToggleButton", [Button, ToggleButtonMixin], {
9 // summary:
10 // A non-templated button widget that can be in two states (checked or not).
11 // Can be base class for things like tabs or checkbox or radio buttons
12
13 baseClass: "mblToggleButton",
14
15 _setCheckedAttr: function(){
16 this.inherited(arguments);
17 var newStateClasses = (this.baseClass+' '+this["class"]).replace(/(\S+)\s*/g, "$1Checked ").split(" ");
18 domClass[this.checked ? "add" : "remove"](this.focusNode || this.domNode, newStateClasses);
19 }
20 });
21 });