提交 b3d34e1f 编写于 作者: I isidor

setData DataTransfers.TEXT multi selection aware

上级 97d9b0c7
......@@ -706,12 +706,12 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
});
// Apply some datatransfer types to allow for dragging the element outside of the application
originalEvent.dataTransfer.setData(DataTransfers.TEXT, sources.map(fs => fs.resource.scheme === 'file' ? getPathLabel(fs.resource) : fs.resource.toString()).join('\n'));
if (sources.length === 1) {
if (!sources[0].isDirectory) {
originalEvent.dataTransfer.setData(DataTransfers.DOWNLOAD_URL, [MIME_BINARY, sources[0].name, sources[0].resource.toString()].join(':'));
}
originalEvent.dataTransfer.setData(DataTransfers.TEXT, getPathLabel(sources[0].resource));
} else {
originalEvent.dataTransfer.setData(DataTransfers.URLS, JSON.stringify(sources.filter(s => !s.isDirectory).map(s => s.resource.toString())));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册