Fix iterating items for closet and skin library

`for...of` is a feature of ES6,
however Babel will transpile this syntax to `Symbol.iterator()`,
which does not supported on IE11.
We won't add `Symbol` polyfill,
because it will increase JS file size.
`Array.prototype.reduce` is of ES5 and supported on IE11.
This commit is contained in:
Pig Fang 2017-12-16 11:03:37 +08:00
parent 76b6d68bc2
commit bec9bdf3f3
2 changed files with 2 additions and 6 deletions

View File

@ -60,9 +60,7 @@ function renderSkinlib(items) {
} else {
$('#skinlib-paginator').show();
for (const item of items) {
container.append(renderSkinlibItemComponent(item));
}
container.html(items.reduce((carry, item) => renderSkinlibItemComponent(item), ''));
}
$('.overlay').hide();

View File

@ -132,9 +132,7 @@ function renderCloset(items, category) {
} else {
$('#closet-paginator').show();
for (let item of items) {
container.append(renderClosetItemComponent(item));
}
container.html(items.reduce((carry, item) => carry + renderClosetItemComponent(item), ''));
}
}