[483] | 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 | // module: |
---|
| 11 | // dojox/mobile/SpinWheelDatePicker |
---|
| 12 | |
---|
| 13 | return declare("dojox.mobile.SpinWheelDatePicker", [SpinWheel, DatePickerMixin], { |
---|
| 14 | // summary: |
---|
| 15 | // A SpinWheel-based date picker widget. |
---|
| 16 | // description: |
---|
| 17 | // SpinWheelDatePicker is a date picker widget. It is a subclass of |
---|
| 18 | // dojox/mobile/SpinWheel. It has three slots: year, month, and day. |
---|
| 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(/*Number*/daysInMonth){ |
---|
| 44 | // summary: |
---|
| 45 | // Disables the end days of the month to match the specified |
---|
| 46 | // number of days of the month. |
---|
| 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 | }); |
---|