Skip to content

Commit

Permalink
Fix toggleable button in hand-tracking example (#5504)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Apr 10, 2024
1 parent 509376f commit 416ac7d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/showcase/hand-tracking/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AFRAME.registerComponent('button', {
schema: {
label: {default: 'label'},
width: {default: 0.11},
toggable: {default: false}
toggleable: {default: false}
},
init: function () {
var el = this.el;
Expand Down Expand Up @@ -58,7 +58,7 @@ AFRAME.registerComponent('button', {
var el = this.el;
el.setAttribute('material', {color: 'green'});
el.emit('click');
if (this.data.togabble) {
if (this.data.toggleable) {
if (el.is('pressed')) {
el.removeState('pressed');
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/showcase/hand-tracking/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<a-entity id="sphereButton" button="label: sphere" position="-0.15 0 0"></a-entity>
<a-entity id="boxButton" button="label: box" position="0 0 0"></a-entity>
<a-entity id="torusButton" button="label: torus" position="0.15 0 0"></a-entity>
<a-entity id="darkModeButton" button="label: Dark Mode; width: 0.20; toggable: true" position="0 -0.10 0"></a-entity>
<a-entity id="darkModeButton" button="label: Dark Mode; width: 0.20; toggleable: true" position="0 -0.10 0"></a-entity>
</a-entity>
<a-entity hand-tracking-controls="hand: left"></a-entity>
<a-entity hand-tracking-controls="hand: right"></a-entity>
Expand Down
2 changes: 1 addition & 1 deletion examples/test/layer/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AFRAME.registerComponent('button', {
schema: {
label: {default: 'label'},
width: {default: 0.50},
toggable: {default: false}
toggleable: {default: false}
},
init: function () {
var el = this.el;
Expand Down

0 comments on commit 416ac7d

Please sign in to comment.