From 428cda67f1f24c9d38ff7dec17b72daa3fe789c6 Mon Sep 17 00:00:00 2001 From: Thomas Smyth Date: Sun, 17 Dec 2017 15:19:22 +0000 Subject: [PATCH] fix hotspot gaze click using bind --- src/embed/hotspot-renderer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/embed/hotspot-renderer.js b/src/embed/hotspot-renderer.js index 6e8cb140..500eb073 100644 --- a/src/embed/hotspot-renderer.js +++ b/src/embed/hotspot-renderer.js @@ -353,11 +353,11 @@ HotspotRenderer.prototype.focus_ = function(id) { this.tween = new TWEEN.Tween(hotspot.scale).to(FOCUS_SCALE, FOCUS_DURATION) .easing(TWEEN.Easing.Quadratic.InOut) .start(); - + if (this.worldRenderer.isVRMode()) { this.timeForHospotClick = setTimeout(function () { this.emit('click', id); - }, 1200 ) + }.bind( this ), 1200 ) } }; @@ -367,7 +367,7 @@ HotspotRenderer.prototype.blur_ = function(id) { this.tween = new TWEEN.Tween(hotspot.scale).to(NORMAL_SCALE, FOCUS_DURATION) .easing(TWEEN.Easing.Quadratic.InOut) .start(); - + if (this.timeForHospotClick) { clearTimeout( this.timeForHospotClick ); }