Skip to content

Commit 37c33d2

Browse files
committed
address comments for ryan betts cursor mouseleave (for aframevr#1882)
1 parent e4900e1 commit 37c33d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/cursor.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ module.exports.Component = registerComponent('cursor', {
133133
// Ignore the cursor.
134134
if (cursorEl === intersectedEl) { return; }
135135

136-
// ignore if the event didn't occur on the current intersection
136+
// Ignore if the event didn't occur on the current intersection.
137137
if (intersectedEl !== this.intersectedEl) { return; }
138138

139139
this.clearCurrentIntersection(intersectedEl);
@@ -160,11 +160,11 @@ module.exports.Component = registerComponent('cursor', {
160160
* Helper to emit on both the cursor and the intersected entity (if exists).
161161
*/
162162
twoWayEmit: function (evtName) {
163+
var el = this.el;
163164
var intersectedEl = this.intersectedEl;
164-
var cursorEvtDetail = { intersectedEl: this.intersectedEl, intersection: this.intersection };
165-
var intersectedElEvtDetail = { cursorEl: this.el, intersection: this.intersection };
166-
this.el.emit(evtName, cursorEvtDetail);
165+
var intersection = this.intersection;
166+
el.emit(evtName, {intersectedEl: intersectedEl, intersection: intersection});
167167
if (!intersectedEl) { return; }
168-
intersectedEl.emit(evtName, intersectedElEvtDetail);
168+
intersectedEl.emit(evtName, {cursorEl: el, intersection: intersection});
169169
}
170170
});

0 commit comments

Comments
 (0)