From aa7bcba91f65f5057857d15701bcf83a1ac7dc0f Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Mon, 23 Nov 2015 17:17:43 +0000 Subject: [PATCH] fix(SlideBox): Fix the slide box sometimes opening the wrong cell. --- src/directives/mwlCalendarMonth.js | 4 ++-- src/directives/mwlCalendarYear.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/directives/mwlCalendarMonth.js b/src/directives/mwlCalendarMonth.js index 6f8aaf28..89fa2972 100644 --- a/src/directives/mwlCalendarMonth.js +++ b/src/directives/mwlCalendarMonth.js @@ -21,8 +21,8 @@ angular } //Auto open the calendar to the current day if set - vm.openDayIndex = null; - if (vm.cellIsOpen) { + if (vm.cellIsOpen && !vm.openRowIndex) { + vm.openDayIndex = null; vm.view.forEach(function(day) { if (day.inMonth && moment(vm.currentDay).startOf('day').isSame(day.date)) { vm.dayClicked(day, true); diff --git a/src/directives/mwlCalendarYear.js b/src/directives/mwlCalendarYear.js index 57d986c2..fe294f16 100644 --- a/src/directives/mwlCalendarYear.js +++ b/src/directives/mwlCalendarYear.js @@ -12,8 +12,8 @@ angular vm.view = calendarHelper.getYearView(vm.events, vm.currentDay, vm.cellModifier); //Auto open the calendar to the current day if set - vm.openMonthIndex = null; - if (vm.cellIsOpen) { + if (vm.cellIsOpen && !vm.openMonthIndex) { + vm.openMonthIndex = null; vm.view.forEach(function(month) { if (moment(vm.currentDay).startOf('month').isSame(month.date)) { vm.monthClicked(month, true);