repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 02e0d6dbe05529e0c98cff7651f25526ba113705:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 02e0d6dbe05529e0c98cff7651f25526ba113705
Author: James Baicoianu 
Date:   Thu Oct 17 17:18:36 2024 -0700

    Remove duplicate player.dispatchEvent() function, clone event when firing

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index ccb11535fa74c4f45f54fee911229771b21b93f1..
index ..1be30cec6ce623c5deda629161a1c8db4cdd0a5b 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -1119,9 +1119,6 @@ document.body.dispatchEvent(click);
         }
       };
     })();
-    this.dispatchEvent = function(event, target) {
-      let firedev = elation.events.fire(event);
-    }
     this.lookAt = function(other, up, turnhead) {
       if (!up) up = new THREE.Vector3(0,1,0);
       if (!other) return;
@@ -1314,8 +1311,9 @@ document.body.dispatchEvent(click);
       let returnValue = true;
       firedev.forEach(e => returnValue &= e.returnValue);
       if (event.bubbles !== false && returnValue && this.parent && this.parent.dispatchEvent) {
-        event.element = this.parent;
-        this.parent.dispatchEvent(event);
+        let ev = elation.events.clone(event);
+        ev.element = this.parent;
+        this.parent.dispatchEvent(ev);
       }
     }
     this.addEventListenerProxy = function(name, handler, bubble) {

-----END OF PAGE-----