working check of all true bools

This commit is contained in:
Mark Eaton 2023-07-22 01:21:29 -04:00
parent b646d0855d
commit 132027e9d7
1 changed files with 10 additions and 2 deletions

View File

@ -28,15 +28,23 @@ AFRAME.registerComponent('markerhandler', {
document.querySelector("#anchorzero").addEventListener('markerFound', () => {
this.markers.reference = true;
document.querySelector('#goalzero').innerHTML = "Reference Desk ✔";
this.check(this.markers);
});
document.querySelector("#anchorone").addEventListener('markerFound', () => {
this.markers.reference = true;
this.markers.circulation = true;
document.querySelector('#goalone').innerHTML = "Circulation Desk ✔";
this.check(this.markers);
});
document.querySelector("#anchortwo").addEventListener('markerFound', () => {
this.markers.reference = true;
this.markers.photocopier = true;
document.querySelector('#goaltwo').innerHTML = "Photocopier/Scanner ✔";
this.check(this.markers);
});
},
check: function (markers) {
if (Object.values(markers).every(Boolean) === true) {
alert("all true")
}
},
});
</script>