pagination

This commit is contained in:
Kevin Ngo
2018-07-21 11:55:44 +02:00
parent b6021277e0
commit 0e1a4e619f
5 changed files with 84 additions and 28 deletions

View File

@@ -3,6 +3,7 @@ AFRAME.registerComponent('keyboard-raycastable', {
play: function () {
// TODO: bind-toggle__raycastable for when search is activated.
this.el.components['super-keyboard'].kbImg.setAttribute('raycastable', '');
this.el.components['super-keyboard'].kbImg.setAttribute('bind-toggle__raycastable',
'menu.active');
},
});

View File

@@ -6,7 +6,7 @@ var bindEvent = require('aframe-event-decorators').bindEvent;
AFRAME.registerComponent('menu-difficulty-select', {
click: bindEvent(function (evt) {
this.el.emit('menudifficultyselect',
evt.target.closest('difficultyOption').dataset.difficulty,
evt.target.closest('.difficultyOption').dataset.difficulty,
false);
})
});

View File

@@ -34,17 +34,19 @@ AFRAME.registerComponent('preview-song', {
// Stop.
if (oldData.challengeId && !this.data.challengeId) {
if (this.animation) { this.animation.pause(); }
this.audio.pause();
if (!this.audio.paused) { this.audio.pause(); }
this.audio.src = '';
return;
}
// Play preview.
this.audio.currentTime = this.data.previewStartTime;
this.audio.src = utils.getS3FileUrl(this.data.challengeId, 'song.ogg');
this.audio.volume = 0;
this.volumeTarget.volume = 0;
this.audio.play();
this.animation.restart();
if (this.data.challengeId) {
this.audio.currentTime = this.data.previewStartTime;
this.audio.src = utils.getS3FileUrl(this.data.challengeId, 'song.ogg');
this.audio.volume = 0;
this.volumeTarget.volume = 0;
this.audio.play();
this.animation.restart();
}
}
});