refactor(menu): gestureCtrl is a private property of menu

This commit is contained in:
Manu Mtz.-Almeida
2016-10-22 18:13:24 +02:00
parent 0005e3416e
commit 8dd66735ab
2 changed files with 9 additions and 5 deletions

View File

@ -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));

View File

@ -303,7 +303,7 @@ export class Menu {
private _renderer: Renderer,
private _keyboard: Keyboard,
private _zone: NgZone,
public gestureCtrl: GestureController
private _gestureCtrl: GestureController
) {}
/**
@ -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