Skip to content

Instantly share code, notes, and snippets.

@rowan-m
Created August 27, 2019 09:19
Show Gist options
  • Save rowan-m/969f253b55c479b481355a9d3daf6a60 to your computer and use it in GitHub Desktop.
Save rowan-m/969f253b55c479b481355a9d3daf6a60 to your computer and use it in GitHub Desktop.
// connectedCallback()
if ('PointerEvent' in window) {
this.addEventListener('pointerdown', this._onPointerdown);
} else {
this.addEventListener('touchstart', this._onTouchstart);
this.addEventListener('mousedown', this._onMousedown);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment