Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
fix(monthView): dont fire on-date-range-sekect when dragging an event
Browse files Browse the repository at this point in the history
Closes #614
  • Loading branch information
Matt Lewis committed Jun 26, 2017
1 parent fedd346 commit 628321c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/directives/mwlCalendarMonth.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ angular
};

vm.onDragSelectEnd = function(day) {
vm.dateRangeSelect.endDate = day.date;
if (vm.dateRangeSelect.endDate > vm.dateRangeSelect.startDate) {
vm.onDateRangeSelect({
calendarRangeStartDate: vm.dateRangeSelect.startDate.clone().startOf('day').toDate(),
calendarRangeEndDate: vm.dateRangeSelect.endDate.clone().endOf('day').toDate()
});
if (vm.dateRangeSelect) {
vm.dateRangeSelect.endDate = day.date;
if (vm.dateRangeSelect.endDate > vm.dateRangeSelect.startDate) {
vm.onDateRangeSelect({
calendarRangeStartDate: vm.dateRangeSelect.startDate.clone().startOf('day').toDate(),
calendarRangeEndDate: vm.dateRangeSelect.endDate.clone().endOf('day').toDate()
});
}
delete vm.dateRangeSelect;
}
delete vm.dateRangeSelect;
};

vm.$onInit = function() {
Expand Down
1 change: 1 addition & 0 deletions src/templates/calendarMonthCellEvents.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="pull-left event"
ng-class="event.cssClass"
ng-style="{backgroundColor: event.color.primary}"
ng-mousedown="$event.stopPropagation()"
ng-mouseenter="vm.highlightEvent(event, true)"
ng-mouseleave="vm.highlightEvent(event, false)"
tooltip-append-to-body="true"
Expand Down
1 change: 1 addition & 0 deletions src/templates/calendarSlideBox.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<li
ng-repeat="event in vm.events | orderBy:'startsAt' track by event.calendarEventId"
ng-class="event.cssClass"
ng-mousedown="$event.stopPropagation()"
mwl-draggable="event.draggable === true"
drop-data="{event: event}"
auto-scroll="vm.draggableAutoScroll">
Expand Down

0 comments on commit 628321c

Please sign in to comment.