Skip to content

Commit

Permalink
fix(dayView): use correct event height when resizing from the top
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Dec 18, 2016
1 parent 007fbc5 commit 1c5e74f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/day/calendarDayViewEvent.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class CalendarDayViewEventComponent {
resizing(event: DayViewEvent, resizeEvent: ResizeEvent): void {
if (resizeEvent.edges.top) {
event.top = this.currentResize.originalTop + +resizeEvent.edges.top;
event.height = this.currentResize.originalHeight - +resizeEvent.edges.top;
} else if (resizeEvent.edges.bottom) {
event.height = this.currentResize.originalHeight + +resizeEvent.edges.bottom;
}
Expand Down
1 change: 1 addition & 0 deletions test/calendarDayView.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ describe('CalendarDayViewComponent component', () => {
triggerDomEvent('mousemove', document.body, {clientY: rect.top - 30, clientX: rect.left + 10});
fixture.detectChanges();
expect(event.getBoundingClientRect().top).to.equal(rect.top - 30);
expect(event.getBoundingClientRect().height).to.equal(rect.height + 30);
triggerDomEvent('mouseup', document.body, {clientY: rect.top - 30, clientX: rect.left + 10});
fixture.detectChanges();
fixture.destroy();
Expand Down

0 comments on commit 1c5e74f

Please sign in to comment.