Skip to content
Snippets Groups Projects
Commit 5d43fce0 authored by johnshaughnessy's avatar johnshaughnessy
Browse files

Fixup emit-state-change

parent 90752c0e
No related branches found
No related tags found
No related merge requests found
......@@ -23,11 +23,14 @@ AFRAME.registerComponent("emit-state-change", {
},
update() {
this.el.removeEventListener("stateadded", this.stateadded);
this.el.removeEventListener("stateremoved", this.stateremoved);
if (this.data.transform === "rising") {
this.el.addEventListener("stateadded", this.stateadded);
}
if (this.data.transform === "falling") {
this.el.addEventListener("stateremoved", this.stateadded);
this.el.addEventListener("stateremoved", this.stateremoved);
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment