Ability to select multiple files to upload (#275)

pull/1/head
yflory 6 years ago
parent 747c7ffdc3
commit c1ef8243a1

@ -631,9 +631,11 @@ define([
if (!data.FM) { return; }
var $input = $('<input>', {
'type': 'file',
'style': 'display: none;'
'style': 'display: none;',
'multiple': 'multiple'
}).on('change', function (e) {
var file = e.target.files[0];
var files = Util.slice(e.target.files);
files.forEach(function (file) {
var ev = {
target: data.target
};
@ -643,11 +645,11 @@ define([
if (data.transformer) {
data.transformer(file, function (newFile) {
data.FM.handleFile(newFile, ev);
if (callback) { callback(); }
});
return;
}
data.FM.handleFile(file, ev);
});
if (callback) { callback(); }
});
if (data.accept) { $input.attr('accept', data.accept); }

@ -1805,15 +1805,18 @@ define([
.click(function () {
var $input = $('<input>', {
'type': 'file',
'style': 'display: none;'
'style': 'display: none;',
'multiple': 'multiple'
}).on('change', function (e) {
var file = e.target.files[0];
var files = Util.slice(e.target.files);
files.forEach(function (file) {
var ev = {
target: $content[0],
path: findDropPath($content[0])
};
APP.FM.handleFile(file, ev);
});
});
$input.click();
});
}

Loading…
Cancel
Save