1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- define("dojox/mobile/Button", [
- "dojo/_base/array",
- "dojo/_base/declare",
- "dojo/dom-class",
- "dojo/dom-construct",
- "dijit/_WidgetBase",
- "dijit/form/_ButtonMixin",
- "dijit/form/_FormWidgetMixin"
- ],
- function(array, declare, domClass, domConstruct, WidgetBase, ButtonMixin, FormWidgetMixin){
-
- return declare("dojox.mobile.Button", [WidgetBase, FormWidgetMixin, ButtonMixin], {
-
-
-
-
-
-
-
-
-
- baseClass: "mblButton",
-
-
- _setTypeAttr: null,
-
-
- duration: 1000,
- _onClick: function(e){
- var ret = this.inherited(arguments);
- if(ret && this.duration >= 0){
- var button = this.focusNode || this.domNode;
- var newStateClasses = (this.baseClass+' '+this["class"]).split(" ");
- newStateClasses = array.map(newStateClasses, function(c){ return c+"Selected"; });
- domClass.add(button, newStateClasses);
- setTimeout(function(){
- domClass.remove(button, newStateClasses);
- }, this.duration);
- }
- return ret;
- },
- isFocusable: function(){ return false; },
- buildRendering: function(){
- if(!this.srcNodeRef){
- this.srcNodeRef = domConstruct.create("button", {"type": this.type});
- }else if(this._cv){
- var n = this.srcNodeRef.firstChild;
- if(n && n.nodeType === 3){
- n.nodeValue = this._cv(n.nodeValue);
- }
- }
- this.inherited(arguments);
- this.focusNode = this.domNode;
- },
- postCreate: function(){
- this.inherited(arguments);
- this.connect(this.domNode, "onclick", "_onClick");
- },
- _setLabelAttr: function(/*String*/ content){
- this.inherited(arguments, [this._cv ? this._cv(content) : content]);
- }
- });
- });
|