| 1 |
define([ |
| 2 |
"dojo/_base/array", |
| 3 |
"dojo/_base/declare", |
| 4 |
"dojo/dom-class", |
| 5 |
"./_DatePickerMixin", |
| 6 |
"./SpinWheel", |
| 7 |
"./SpinWheelSlot" |
| 8 |
], function(array, declare, domClass, DatePickerMixin, SpinWheel, SpinWheelSlot){ |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
return declare("dojox.mobile.SpinWheelDatePicker", [SpinWheel, DatePickerMixin], { |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
slotClasses: [ |
| 21 |
SpinWheelSlot, |
| 22 |
SpinWheelSlot, |
| 23 |
SpinWheelSlot |
| 24 |
], |
| 25 |
|
| 26 |
slotProps: [ |
| 27 |
{labelFrom:1970, labelTo:2038}, |
| 28 |
{}, |
| 29 |
{} |
| 30 |
], |
| 31 |
|
| 32 |
buildRendering: function(){ |
| 33 |
this.initSlots(); |
| 34 |
this.inherited(arguments); |
| 35 |
domClass.add(this.domNode, "mblSpinWheelDatePicker"); |
| 36 |
this._conn = [ |
| 37 |
this.connect(this.slots[0], "onFlickAnimationEnd", "_onYearSet"), |
| 38 |
this.connect(this.slots[1], "onFlickAnimationEnd", "_onMonthSet"), |
| 39 |
this.connect(this.slots[2], "onFlickAnimationEnd", "_onDaySet") |
| 40 |
]; |
| 41 |
}, |
| 42 |
|
| 43 |
disableValues: function(daysInMonth){ |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
array.forEach(this.slots[2].panelNodes, function(panel){ |
| 48 |
for(var i = 27; i < 31; i++){ |
| 49 |
domClass.toggle(panel.childNodes[i], "mblSpinWheelSlotLabelGray", i >= daysInMonth); |
| 50 |
} |
| 51 |
}); |
| 52 |
} |
| 53 |
}); |
| 54 |
}); |