diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index bf40e914f..da1244d91 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -2519,7 +2519,7 @@ Zotero.ItemTreeView.prototype.onDragStart = function (event) { var itemIDs = this.getSelectedItems(true); event.dataTransfer.setData("zotero/item", itemIDs); // dataTransfer.mozSourceNode doesn't seem to be properly set anymore (tested in 50), so store - // target separately + // event target separately if (!event.dataTransfer.mozSourceNode) { Zotero.debug("mozSourceNode not set -- storing source node"); Zotero.DragDrop.currentSourceNode = event.target; diff --git a/chrome/content/zotero/xpcom/libraryTreeView.js b/chrome/content/zotero/xpcom/libraryTreeView.js index 065e93aad..01c50532c 100644 --- a/chrome/content/zotero/xpcom/libraryTreeView.js +++ b/chrome/content/zotero/xpcom/libraryTreeView.js @@ -357,6 +357,32 @@ Zotero.LibraryTreeView.prototype = { this._setDropEffect(event, "copy"); } } + else if (event.dataTransfer.getData("zotero/collection")) { + let collectionID = Zotero.DragDrop.getDataFromDataTransfer(event.dataTransfer).data[0]; + let { libraryID: sourceLibraryID } = Zotero.Collections.getLibraryAndKeyFromID(collectionID); + + if (this.type == 'collection') { + var targetCollectionTreeRow = Zotero.DragDrop.getDragTarget(event); + } + else { + throw new Error("Invalid type '" + this.type + "'"); + } + + // For now, all cross-library drags are copies + if (sourceLibraryID != targetCollectionTreeRow.ref.libraryID) { + /*if ((Zotero.isMac && event.metaKey) || (!Zotero.isMac && event.shiftKey)) { + this._setDropEffect(event, "move"); + } + else { + this._setDropEffect(event, "copy"); + }*/ + this._setDropEffect(event, "copy"); + return false; + } + + // And everything else is a move + this._setDropEffect(event, "move"); + } else if (event.dataTransfer.types.contains("application/x-moz-file")) { // As of Aug. 2013 nightlies: //