Skip to content

Commit

Permalink
perf(menu): avoiding change detection when unneeded
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Nov 2, 2016
1 parent c76d15d commit 479d500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/menu/menu-gestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
threshold: 0,
maxEdgeStart: menu.maxEdgeStart || 50,
maxAngle: 40,
zone: false,
debouncer: new NativeRafDebouncer(),
gesture: gestureCtrl.create('menu-swipe', {
priority: GesturePriority.MenuSwipe,
Expand Down Expand Up @@ -58,7 +59,6 @@ export class MenuContentGesture extends SlideEdgeGesture {
'z', z,
'stepValue', stepValue);

ev.preventDefault();
this.menu.swipeProgress(stepValue);
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ export class Menu {
return;
}
this._getType().setProgessStep(stepValue);
this.ionDrag.emit(stepValue);

let ionDrag = this.ionDrag;
if (ionDrag.observers.length > 0) {
this._zone.run(ionDrag.emit.bind(ionDrag, stepValue));
}
}

/**
Expand Down

0 comments on commit 479d500

Please sign in to comment.