Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (21 sloc) 744 Bytes
import { HammerGestureConfig } from '@angular/platform-browser';
import { Injectable } from '@angular/core';
declare const Hammer: any;
@Injectable()
export class CustomHammerConfig extends HammerGestureConfig {
buildHammer(element: HTMLElement) {
let options = {};
if (element.hasAttribute('data-calendar-clickable')) {
options = { touchAction: 'pan-y' };
}
const mc = new Hammer(element, options);
// keep default angular config
mc.get('pinch').set({ enable: true });
mc.get('rotate').set({ enable: true });
// retain support for angular overrides object
Object.keys(this.overrides).forEach(eventName => {
mc.get(eventName).set(this.overrides[eventName]);
});
return mc;
}
}
You can’t perform that action at this time.