| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/_base/array", |
| 4 |
"dojo/dom-construct", |
| 5 |
"./_PickerBase", |
| 6 |
"./SpinWheelSlot" |
| 7 |
], function(declare, array, domConstruct, PickerBase){ |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
return declare("dojox.mobile.SpinWheel", PickerBase, { |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
baseClass: "mblSpinWheel", |
| 22 |
|
| 23 |
buildRendering: function(){ |
| 24 |
this.inherited(arguments); |
| 25 |
domConstruct.create("div", {className: "mblSpinWheelBar"}, this.domNode); |
| 26 |
}, |
| 27 |
|
| 28 |
startup: function(){ |
| 29 |
if(this._started){ return; } |
| 30 |
this.centerPos = Math.round(this.domNode.offsetHeight / 2); |
| 31 |
this.inherited(arguments); |
| 32 |
}, |
| 33 |
|
| 34 |
resize: function() { |
| 35 |
this.centerPos = Math.round(this.domNode.offsetHeight / 2); |
| 36 |
array.forEach(this.getChildren(), function(child){ |
| 37 |
child.resize && child.resize(); |
| 38 |
}); |
| 39 |
}, |
| 40 |
|
| 41 |
addChild: function( widget, insertIndex){ |
| 42 |
this.inherited(arguments); |
| 43 |
if(this._started){ |
| 44 |
widget.setInitialValue(); |
| 45 |
} |
| 46 |
} |
| 47 |
}); |
| 48 |
}); |