mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
refs #11864 handle empty dir drop in Files UI
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
parent
586cc9bcbc
commit
742703c92f
2 changed files with 19 additions and 3 deletions
|
|
@ -215,6 +215,12 @@ OC.FileUpload.prototype = {
|
|||
var data = this.data;
|
||||
var file = this.getFile();
|
||||
|
||||
// if file is a directory, just create it
|
||||
// files are handled separately
|
||||
if (file.isDirectory) {
|
||||
return this.uploader.ensureFolderExists(OC.joinPaths(this._targetFolder, file.fullPath));
|
||||
}
|
||||
|
||||
if (self.aborted === true) {
|
||||
return $.Deferred().resolve().promise();
|
||||
}
|
||||
|
|
|
|||
16
apps/files/js/jquery.fileupload.js
vendored
16
apps/files/js/jquery.fileupload.js
vendored
|
|
@ -1029,7 +1029,12 @@
|
|||
} else {
|
||||
paramNameSet = paramName;
|
||||
}
|
||||
data.originalFiles = files;
|
||||
data.originalFiles = [];
|
||||
$.each(files, function (file) {
|
||||
if (!file.isDirectory) {
|
||||
data.originalFiles.push(file);
|
||||
}
|
||||
});
|
||||
$.each(fileSet || files, function (index, element) {
|
||||
var newData = $.extend({}, data);
|
||||
newData.files = fileSet ? element : [element];
|
||||
|
|
@ -1098,7 +1103,12 @@
|
|||
entries,
|
||||
path + entry.name + '/'
|
||||
).done(function (files) {
|
||||
dfd.resolve(files);
|
||||
// empty folder
|
||||
if (!files.length && entry.isDirectory) {
|
||||
dfd.resolve(entry);
|
||||
} else {
|
||||
dfd.resolve(files);
|
||||
}
|
||||
}).fail(errorHandler);
|
||||
},
|
||||
readEntries = function () {
|
||||
|
|
@ -1486,4 +1496,4 @@
|
|||
|
||||
});
|
||||
|
||||
}));
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in a new issue