Skip to content

Commit

Permalink
refactor(menu): gestureCtrl is a private property of menu
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Oct 22, 2016
1 parent 0005e34 commit 8dd6673
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/components/menu/menu-gestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ import { Menu } from './menu';
import { SlideEdgeGesture } from '../../gestures/slide-edge-gesture';
import { SlideData } from '../../gestures/slide-gesture';
import { assign } from '../../util/util';
import { GesturePriority } from '../../gestures/gesture-controller';
import { GestureController, GesturePriority } from '../../gestures/gesture-controller';

/**
* Gesture attached to the content which the menu is assigned to
*/
export class MenuContentGesture extends SlideEdgeGesture {

constructor(public menu: Menu, contentEle: HTMLElement, options: any = {}) {
constructor(
public menu: Menu,
gestureCtrl: GestureController,
contentEle: HTMLElement,
options: any = {}) {
super(contentEle, assign({
direction: 'x',
edge: menu.side,
threshold: 0,
maxEdgeStart: menu.maxEdgeStart || 50,
maxAngle: 40,
gesture: menu.gestureCtrl.create('menu-swipe', {
gesture: gestureCtrl.create('menu-swipe', {
priority: GesturePriority.MenuSwipe,
})
}, options));
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Menu {
private _renderer: Renderer,
private _keyboard: Keyboard,
private _zone: NgZone,
public gestureCtrl: GestureController
private _gestureCtrl: GestureController
) {}

/**
Expand Down Expand Up @@ -333,7 +333,7 @@ export class Menu {
this.setElementAttribute('type', this.type);

// add the gestures
this._cntGesture = new MenuContentGesture(this, document.body);
this._cntGesture = new MenuContentGesture(this, this._gestureCtrl, document.body);

// register listeners if this menu is enabled
// check if more than one menu is on the same side
Expand Down

0 comments on commit 8dd6673

Please sign in to comment.