60 lines
1.2 KiB
TypeScript
60 lines
1.2 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {StringMapWrapper} from '../../facade/collection';
|
|
|
|
import {EventManagerPlugin} from './event_manager';
|
|
|
|
var _eventNames = {
|
|
// pan
|
|
'pan': true,
|
|
'panstart': true,
|
|
'panmove': true,
|
|
'panend': true,
|
|
'pancancel': true,
|
|
'panleft': true,
|
|
'panright': true,
|
|
'panup': true,
|
|
'pandown': true,
|
|
// pinch
|
|
'pinch': true,
|
|
'pinchstart': true,
|
|
'pinchmove': true,
|
|
'pinchend': true,
|
|
'pinchcancel': true,
|
|
'pinchin': true,
|
|
'pinchout': true,
|
|
// press
|
|
'press': true,
|
|
'pressup': true,
|
|
// rotate
|
|
'rotate': true,
|
|
'rotatestart': true,
|
|
'rotatemove': true,
|
|
'rotateend': true,
|
|
'rotatecancel': true,
|
|
// swipe
|
|
'swipe': true,
|
|
'swipeleft': true,
|
|
'swiperight': true,
|
|
'swipeup': true,
|
|
'swipedown': true,
|
|
// tap
|
|
'tap': true,
|
|
};
|
|
|
|
|
|
export class HammerGesturesPluginCommon extends EventManagerPlugin {
|
|
constructor() { super(); }
|
|
|
|
supports(eventName: string): boolean {
|
|
eventName = eventName.toLowerCase();
|
|
return StringMapWrapper.contains(_eventNames, eventName);
|
|
}
|
|
}
|