diff --git a/src/components/cursor-controller.js b/src/components/cursor-controller.js index a66fd059b840fde757803eae6ed2ba245d4a1e33..6183eb6664331d6615d0e53776556b03d9c9ad58 100644 --- a/src/components/cursor-controller.js +++ b/src/components/cursor-controller.js @@ -312,7 +312,7 @@ AFRAME.registerComponent("cursor-controller", { !this.isMobile || this.hasPointingDevice || !this.activeTouch || - e.touches.some(touch => touch.identifier === this.activeTouch.identifier) + this.some(e.touches, touch => touch.identifier === this.activeTouch.identifier) ) { return; } @@ -443,5 +443,12 @@ AFRAME.registerComponent("cursor-controller", { } else { this.controller = null; } + }, + + some: function(a, fn) { + for (let i = 0; i < a.length; a++) { + if (fn(a[i])) return true; + } + return false; } });