summaryrefslogtreecommitdiff
path: root/js/dojo-1.7.2/dojox/mobile/ToggleButton.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo-1.7.2/dojox/mobile/ToggleButton.js')
-rw-r--r--js/dojo-1.7.2/dojox/mobile/ToggleButton.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/dojo-1.7.2/dojox/mobile/ToggleButton.js b/js/dojo-1.7.2/dojox/mobile/ToggleButton.js
new file mode 100644
index 0000000..c12dcc5
--- /dev/null
+++ b/js/dojo-1.7.2/dojox/mobile/ToggleButton.js
@@ -0,0 +1,26 @@
+//>>built
+define("dojox/mobile/ToggleButton", [
+ "dojo/_base/declare",
+ "dojo/dom-class",
+ "dijit/form/_ToggleButtonMixin",
+ "./Button"
+], function(declare, domClass, ToggleButtonMixin, Button){
+
+ /*=====
+ Button = dojox.mobile.Button;
+ ToggleButtonMixin = dijit.form._ToggleButtonMixin;
+ =====*/
+ return declare("dojox.mobile.ToggleButton", [Button, ToggleButtonMixin], {
+ // summary:
+ // A non-templated button widget that can be in two states (checked or not).
+ // Can be base class for things like tabs or checkbox or radio buttons
+
+ baseClass: "mblToggleButton",
+
+ _setCheckedAttr: function(){
+ this.inherited(arguments);
+ var newStateClasses = (this.baseClass+' '+this["class"]).replace(/(\S+)\s*/g, "$1Checked ").split(" ");
+ domClass[this.checked ? "add" : "remove"](this.focusNode || this.domNode, newStateClasses);
+ }
+ });
+});