From f5ef980086b3f828c383f3d0a275468fdac1e294 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 11 Jan 2018 18:07:48 +0100 Subject: [PATCH] Remove uploading from Droppable --- src/utils/Droppable.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/utils/Droppable.js b/src/utils/Droppable.js index 9111e8729..3276a87b0 100644 --- a/src/utils/Droppable.js +++ b/src/utils/Droppable.js @@ -116,13 +116,16 @@ export default class Droppable { content = []; for (let i = 0; i < files.length; i++) { const file = files[i]; - content.push({ - type: 'image', - attributes: { alt: file.name } - }); + const type = file.type.split('/')[0]; + + if (type == 'image') { + content.push({ + type, + file, + attributes: { alt: file.name } + }); + } } - const fu = em.get('AssetManager').FileUploader(); - fu.uploadFile({ dataTransfer }, res => console.log('RES upload', res)); } else if (types.indexOf('text/html') >= 0) { content = dataTransfer .getData('text/html')