restyled genres menu

This commit is contained in:
Diego F. Goberna
2018-10-30 02:20:14 +01:00
parent 8274ccca51
commit e8c8a6a702
6 changed files with 52 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ AFRAME.registerComponent('gpu-preloader', {
this.preloadSearchPrevPage();
this.preloadWallMap();
this.preloadWrongMap();
this.preloadGenres();
}, 1000);
},
@@ -85,6 +86,11 @@ AFRAME.registerComponent('gpu-preloader', {
this.preloadTexture(wrong.getObject3D('mesh').material.map);
},
preloadGenres: function () {
const genres = document.querySelector('.genreIcon');
this.preloadTexture(genres.getObject3D('mesh').material.map);
},
preloadTexture: function (texture) {
if (!texture || !texture.image) {
console.warn('[gpu-preloader] Error preloading texture', texture);

View File

@@ -65,7 +65,7 @@ AFRAME.registerComponent('search-genre', {
};
this.el.addEventListener('click', evt => {
this.search(evt.target.closest('.genre').dataset.genre);
this.search(evt.target.closest('.genre').dataset.bindForKey);
});
},