diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 7690e06b4..bb0a6f5ab 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -2485,47 +2485,49 @@ Zotero.ItemTreeView.prototype.onDragStart = function (event) { var items = Zotero.Items.get(itemIDs); - // Multi-file drag - // - Doesn't work on Windows - if (!Zotero.isWin) { - // If at least one file is a non-web-link attachment and can be found, - // enable dragging to file system - for (var i=0; i item.isAttachment()) + .map(item => item.getFilePath()) + .filter(path => path); + + if (files.length) { + // Advanced multi-file drag (with unique filenames, which otherwise happen automatically on + // Windows but not Linux) and auxiliary snapshot file copying on macOS + let dataProvider; + if (Zotero.isMac) { + dataProvider = new Zotero.ItemTreeView.fileDragDataProvider(itemIDs); } - } - // Copy first file on Windows - else { - var index = 0; - for (var i=0; i