diff --git a/src/component-systems/RapierPhysicsSystem.js b/src/component-systems/RapierPhysicsSystem.js index 07837e70..1d1dd517 100644 --- a/src/component-systems/RapierPhysicsSystem.js +++ b/src/component-systems/RapierPhysicsSystem.js @@ -86,7 +86,7 @@ export class RapierPhysicsSystem extends System { this.touchDelta.subVectors(this.tempLocalPosition, this.tempPreviousPosition) entity.dispatchEvent( - new CustomEvent(`touch`, { + new CustomEvent('touch', { bubbles: true, detail: { joint, @@ -157,7 +157,7 @@ export class RapierPhysicsSystem extends System { // Contact information can be read from `manifold`. entity.dispatchEvent( - new CustomEvent(`click`, { + new CustomEvent('click', { bubbles: true, detail: { worldPosition: this.tempWorldPosition, @@ -166,7 +166,7 @@ export class RapierPhysicsSystem extends System { }) ) entity.dispatchEvent( - new CustomEvent(`touch-start`, { + new CustomEvent('touch-start', { bubbles: true, detail: { worldPosition: this.tempWorldPosition, @@ -185,7 +185,7 @@ export class RapierPhysicsSystem extends System { this.tempWorldPosition.set(0, 0, 0) entity.touch = false entity.dispatchEvent( - new CustomEvent(`touch-end`, { + new CustomEvent('touch-end', { bubbles: true, }) ) @@ -197,7 +197,7 @@ export class RapierPhysicsSystem extends System { this.tempWorldPosition.copy(manifold.localContactPoint2(0)) entity.object3D.localToWorld(this.tempWorldPosition) entity.dispatchEvent( - new CustomEvent(`hover-start`, { + new CustomEvent('hover-start', { bubbles: true, detail: { worldPosition: this.tempWorldPosition, @@ -210,7 +210,7 @@ export class RapierPhysicsSystem extends System { hoverEnd = (entity) => { entity.dispatchEvent( - new CustomEvent(`hover-end`, { + new CustomEvent('hover-end', { bubbles: true, }) ) diff --git a/src/core/MRApp.js b/src/core/MRApp.js index 26c20a91..9e4dd340 100644 --- a/src/core/MRApp.js +++ b/src/core/MRApp.js @@ -16,6 +16,7 @@ import { parseAttributeString, parseVector } from '../utils/parser.js' import { SurfaceSystem } from '../component-systems/SurfaceSystem.js' import { ClippingSystem } from '../component-systems/ClippingSystem' import { StyleSystem } from '../component-systems/StyleSystem' + ;('use strict') window.mobileCheck = function () { diff --git a/src/core/entity.js b/src/core/entity.js index a0a61e0f..95db8da8 100644 --- a/src/core/entity.js +++ b/src/core/entity.js @@ -149,7 +149,7 @@ export default class Entity extends MRElement { this.connected() document.addEventListener('engine-started', (event) => { - this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true })) + this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true })) }) this.addEventListener('touch-start', (event) => { @@ -168,7 +168,7 @@ export default class Entity extends MRElement { this.onHover(event) }) - this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true })) + this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true })) } /** diff --git a/src/core/rapier.js b/src/core/rapier.js index c2f77d47..3839822c 100644 --- a/src/core/rapier.js +++ b/src/core/rapier.js @@ -2,5 +2,5 @@ export let RAPIER = null import('@dimforge/rapier3d').then((rap) => { RAPIER = rap - document.dispatchEvent(new CustomEvent(`engine-started`, { bubbles: true })) + document.dispatchEvent(new CustomEvent('engine-started', { bubbles: true })) }) diff --git a/src/entities/Model.js b/src/entities/Model.js index 48aef494..01046e5a 100644 --- a/src/entities/Model.js +++ b/src/entities/Model.js @@ -57,7 +57,7 @@ export class Model extends Entity { this.object3D.add(mesh) - this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true })) + this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true })) }) }