in src/app/webserver/files/webfiles.service.ts [180:211]
public drop(e: DragEvent, destination: WebFile | string) {
let apiFiles = this._svc.getDraggedFiles(e);
let items = e.dataTransfer.items;
let files = e.dataTransfer.files;
let copy = (e.dataTransfer.effectAllowed == "all") || ((e.dataTransfer.effectAllowed.toLowerCase() == "copymove") && e.ctrlKey);
let promise = (destination instanceof WebFile) ? Promise.resolve(destination) : this.getFile(destination);
promise.then(dir => {
//
// Copy/Move File(s)
if (apiFiles.length > 0) {
apiFiles = apiFiles.filter(f => f);
copy ? this._svc.copy(apiFiles, dir.file_info) : this._svc.move(apiFiles, dir.file_info);
return;
}
//
// Upload items
if (items && items.length > 0) {
this._svc.uploadItems(<any>items, dir.file_info);
return;
}
//
// Upload local File(s)
if (files && files.length > 0) {
this.upload(<any>files, dir);
return;
}
});
}