import { GESTURE_PRIORITY_TOGGLE , GESTURE_TOGGLE , GestureController } from '../../gestures/gesture-controller' ; import { DomController } from '../../platform/dom-controller' ; import { PanGesture } from '../../gestures/pan-gesture' ; import { Platform } from '../../platform/platform' ; import { pointerCoord } from '../../util/dom' ; import { Toggle } from './toggle' ; hidden export class ToggleGesture extends PanGesture { constructor ( plt , public toggle , gestureCtrl , domCtrl ) { super ( plt , toggle . getNativeElement ( ) , { threshold : 0 , zone : false , domController : domCtrl , gesture : gestureCtrl . createGesture ( { name : GESTURE_TOGGLE , priority : GESTURE_PRIORITY_TOGGLE } ) } ) ; } canStart ( ) { return true ; } onDragStart ( ev ) { ev . preventDefault ( ) ; this . toggle . _onDragStart ( pointerCoord ( ev ) . x ) ; } onDragMove ( ev ) { ev . preventDefault ( ) ; this . toggle . _onDragMove ( pointerCoord ( ev ) . x ) ; } onDragEnd ( ev ) { ev . preventDefault ( ) ; this . toggle . _onDragEnd ( pointerCoord ( ev ) . x ) ; } }