Skip to content

Commit

Permalink
Merge pull request #35 from zhangbobell/master
Browse files Browse the repository at this point in the history
fix(device): fixed detect method of supporting Touch Event
  • Loading branch information
zhangbobell committed Dec 5, 2017
2 parents c4f41bd + 75c401e commit 7efe0ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/device.ts
Expand Up @@ -35,7 +35,7 @@ export class Device {
public transitionEvent: string;

constructor(global) {
this.hasTouch = !!(('ontouchstart' in global && !/Mac OS X /.test(global.navigator.userAgent))
this.hasTouch = !!('ontouchstart' in global
|| (global.DocumentTouch && global.document instanceof global.DocumentTouch));

this.startEvent = this.hasTouch ? 'touchstart' : 'mousedown';
Expand Down

0 comments on commit 7efe0ce

Please sign in to comment.