0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 fix editor image uploads in Edge (#687)

no issue

- babel's transpilation of the `for...of` loops was resulting in an error in MS Edge, dropping back to an old `for` loop fixed it
This commit is contained in:
Kevin Ansfield 2017-05-12 09:02:33 +01:00 committed by Katharina Irrgang
parent e1b4ccd8d4
commit ecbe84025f

View file

@ -106,7 +106,10 @@ export default Component.extend({
let ok = [];
let errors = [];
for (let file of files) {
// NOTE: for...of loop results in a transpilation that errors in Edge,
// once we drop IE11 support we should be able to use native for...of
for (let i = 0; i < files.length; i++) {
let file = files[i];
let result = validate(file);
if (result === true) {
ok.push(file);
@ -147,8 +150,10 @@ export default Component.extend({
this.onStart();
for (let file of files) {
uploads.push(this.get('_uploadFile').perform(file));
// NOTE: for...of loop results in a transpilation that errors in Edge,
// once we drop IE11 support we should be able to use native for...of
for (let i = 0; i < files.length; i++) {
uploads.push(this.get('_uploadFile').perform(files[i]));
}
// populates this.errors and this.uploadUrls