~pkunal-parmar/ubuntu-calendar-app/Minor-Performance

« back to all changes in this revision

Viewing changes to MonthView.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2013-09-18 12:37:45 UTC
  • mfrom: (114.2.4 ubuntu-calendar-app)
  • Revision ID: tarmac-20130918123745-da9n919xckd29zjj
DayView and WeekView header transition.

Approved by Olivier Tilloy, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
            monthDate: getMonthDate();
50
50
 
51
51
            function getMonthDate() {
52
 
                //previous page
53
 
                if (index === monthViewPath.currentIndex) {
 
52
                switch( monthViewPath.indexType(index)) {
 
53
                case 0:
54
54
                    return monthViewPath.startMonth;
55
 
                }
56
 
 
57
 
                //next page
58
 
                var previousIndex = monthViewPath.currentIndex > 0 ? monthViewPath.currentIndex - 1 : 2
59
 
                if ( index === previousIndex ) {
 
55
                case -1:
60
56
                    return monthViewPath.addMonth(monthViewPath.startMonth,2);
 
57
                case 1:
 
58
                    return monthViewPath.addMonth(monthViewPath.startMonth,1);
61
59
                }
62
 
 
63
 
                //current page
64
 
                return monthViewPath.addMonth(monthViewPath.startMonth,1);
65
60
            }
66
61
 
67
62
            onDateSelected: {