fix menu difficulty list rendering
This commit is contained in:
@@ -4,6 +4,14 @@ var bindEvent = require('aframe-event-decorators').bindEvent;
|
||||
* Select difficulty.
|
||||
*/
|
||||
AFRAME.registerComponent('menu-difficulty-select', {
|
||||
init: function () {
|
||||
this.el.sceneEl.addEventListener('menuchallengeselect', () => {
|
||||
setTimeout(() => {
|
||||
this.el.components.layout.update();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
click: bindEvent(function (evt) {
|
||||
this.el.emit('menudifficultyselect',
|
||||
evt.target.closest('.difficultyOption').dataset.difficulty,
|
||||
|
||||
@@ -25,11 +25,11 @@ AFRAME.registerComponent('song', {
|
||||
let songUrl = utils.getS3FileUrl(data.challengeId, 'song.ogg');
|
||||
this.audio.currentTime = 0;
|
||||
this.audio.src = data.challengeId ? songUrl : '';
|
||||
console.log(`Playing ${songUrl}...`);
|
||||
}
|
||||
|
||||
// Keep playback state up to date.
|
||||
if ((data.isPlaying && data.challengeId) && this.audio.paused) {
|
||||
console.log(`Playing ${this.audio.src}...`);
|
||||
this.audio.play();
|
||||
return;
|
||||
} else if ((!data.isPlaying || !data.challengeId) && !this.audio.paused) {
|
||||
|
||||
Reference in New Issue
Block a user