fix menu difficulty list rendering

This commit is contained in:
Kevin Ngo
2018-07-21 20:53:24 +02:00
parent a33f301a6a
commit 7f4116860d
5 changed files with 16 additions and 6 deletions

View File

@@ -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,