Skip to content

Commit

Permalink
fix(refresh): use markForCheck instead of detectChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed May 17, 2017
1 parent 6ea29ec commit 16dc938
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/day/calendarDayView.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class CalendarDayViewComponent implements OnChanges, OnInit, OnDestroy {
if (this.refresh) {
this.refreshSubscription = this.refresh.subscribe(() => {
this.refreshAll();
this.cdr.detectChanges();
this.cdr.markForCheck();
});
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ export class CalendarDayViewComponent implements OnChanges, OnInit, OnDestroy {
};
const resizeHelper: CalendarResizeHelper = new CalendarResizeHelper(dayViewContainer);
this.validateResize = ({rectangle}) => resizeHelper.validateResize({rectangle});
this.cdr.detectChanges();
this.cdr.markForCheck();
}

resizing(event: DayViewEvent, resizeEvent: ResizeEvent): void {
Expand Down Expand Up @@ -357,7 +357,7 @@ export class CalendarDayViewComponent implements OnChanges, OnInit, OnDestroy {
dragStart(event: HTMLElement, dayViewContainer: HTMLElement): void {
const dragHelper: CalendarDragHelper = new CalendarDragHelper(dayViewContainer, event);
this.validateDrag = ({x, y}) => !this.currentResize && dragHelper.validateDrag({x, y});
this.cdr.detectChanges();
this.cdr.markForCheck();
}

eventDragged(dayEvent: DayViewEvent, draggedInPixels: number): void {
Expand Down
2 changes: 1 addition & 1 deletion src/components/month/calendarMonthView.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
if (this.refresh) {
this.refreshSubscription = this.refresh.subscribe(() => {
this.refreshAll();
this.cdr.detectChanges();
this.cdr.markForCheck();
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/week/calendarWeekView.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class CalendarWeekViewComponent implements OnChanges, OnInit, OnDestroy {
if (this.refresh) {
this.refreshSubscription = this.refresh.subscribe(() => {
this.refreshAll();
this.cdr.detectChanges();
this.cdr.markForCheck();
});
}
}
Expand Down Expand Up @@ -235,7 +235,7 @@ export class CalendarWeekViewComponent implements OnChanges, OnInit, OnDestroy {
};
const resizeHelper: CalendarResizeHelper = new CalendarResizeHelper(weekViewContainer, this.getDayColumnWidth(weekViewContainer));
this.validateResize = ({rectangle}) => resizeHelper.validateResize({rectangle});
this.cdr.detectChanges();
this.cdr.markForCheck();
}

/**
Expand Down Expand Up @@ -309,7 +309,7 @@ export class CalendarWeekViewComponent implements OnChanges, OnInit, OnDestroy {
dragStart(weekViewContainer: HTMLElement, event: HTMLElement): void {
const dragHelper: CalendarDragHelper = new CalendarDragHelper(weekViewContainer, event);
this.validateDrag = ({x, y}) => !this.currentResize && dragHelper.validateDrag({x, y});
this.cdr.detectChanges();
this.cdr.markForCheck();
}

private refreshHeader(): void {
Expand Down

0 comments on commit 16dc938

Please sign in to comment.