From: Alan Knowles Date: Fri, 5 Mar 2021 07:05:01 +0000 (+0800) Subject: Roo/bootstrap/CardUploader.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=7bcb789dd2057c086c42e54664c08d914d6c1543 Roo/bootstrap/CardUploader.js --- diff --git a/Roo/bootstrap/CardUploader.js b/Roo/bootstrap/CardUploader.js index adbcace7b3..b81dd26930 100644 --- a/Roo/bootstrap/CardUploader.js +++ b/Roo/bootstrap/CardUploader.js @@ -320,26 +320,12 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { { var i =0; var data = []; - var dom = this.inputEl().dom; - var fc = this.fileCollection; - var next = function() { - if (i >= fc.length) { - dom.value = JSON.stringify(data); - return; - } - var reader = new FileReader(); - reader.onloadend = function(evt) { - // file is loaded - var ee = Roo.apply({}, fc[i]); - ee.src = evt.target.result; - data.push(ee); - i++; - next(); - }; - reader.readAsDataURL(fc[i].src); + this.fileCollection.forEach(function(e) { + data.push(e.data); - } - next(); + }); + this.inputEl().dom.value = JSON.stringify(data); + }