core/compiler/events -> render/dom/events core/compiler/url_resolver -> services/url_resolver core/compiler/xhr/* -> services/*
53 lines
1.0 KiB
JavaScript
53 lines
1.0 KiB
JavaScript
import {EventManagerPlugin} from './event_manager';
|
|
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
|
|
|
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);
|
|
}
|
|
}
|