Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Commit

Permalink
Avoid arrow function to support es5-only browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
taye authored and jsantell committed Nov 28, 2017
1 parent 7bfff89 commit 8966d4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/embed/hotspot-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ HotspotRenderer.prototype.focus_ = function(id) {
.start();

if (this.worldRenderer.isVRMode()) {
this.timeForHospotClick = setTimeout(() => {
this.timeForHospotClick = setTimeout(function () {
this.emit('click', id);
}, 1200 )
}
Expand Down

1 comment on commit 8966d4f

@tommytee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the this keyword, making this.emit('click', id) not work.

The ES6 arrow function was requested here #210

The build scripts already use uglify-es.

The earlier ES5 version:

this.timeForHospotClick = setTimeout( function () {
    this.emit( 'click', id );
}.bind( this ), 1200 )

Please sign in to comment.