Bit more robust icon loading

This commit is contained in:
Paulus Schoutsen 2015-11-28 22:12:45 -08:00
parent f29b1062b3
commit 33124030f6

View File

@ -54,9 +54,12 @@ export default new Polymer({
},
loadIcons() {
// If the import fails, we'll try to import again, must be a server glitch
// Since HTML imports only resolve once, we import another url.
const success = () => this.iconsLoaded = true;
this.importHref(`/static/mdi-${this.icons}.html`,
() => this.iconsLoaded = true,
() => this.loadIcons());
success,
this.importHref(`/static/mdi.html`, success, success));
},
ready() {