Merge branch '4.0'

This commit is contained in:
Dan Stillman 2016-09-30 02:58:52 -04:00
commit 28601a4380

View file

@ -2498,7 +2498,7 @@ Zotero.ItemTreeView.prototype.onDragStart = function (event) {
Zotero.debug("Adding file via x-moz-file-promise");
event.dataTransfer.mozSetDataAt(
"application/x-moz-file-promise",
new Zotero.ItemTreeView.fileDragDataProvider(),
new Zotero.ItemTreeView.fileDragDataProvider(itemIDs),
0
);
break;
@ -2575,7 +2575,9 @@ Zotero.ItemTreeView.prototype.onDragStart = function (event) {
// Implements nsIFlavorDataProvider for dragging attachment files to OS
//
// Not used on Windows in Firefox 3 or higher
Zotero.ItemTreeView.fileDragDataProvider = function() { };
Zotero.ItemTreeView.fileDragDataProvider = function (itemIDs) {
this._itemIDs = itemIDs;
};
Zotero.ItemTreeView.fileDragDataProvider.prototype = {
QueryInterface : function(iid) {
@ -2599,13 +2601,7 @@ Zotero.ItemTreeView.fileDragDataProvider.prototype = {
transferable.getTransferData("application/x-moz-file-promise-dir", dirPrimitive, dataSize);
var destDir = dirPrimitive.value.QueryInterface(Components.interfaces.nsILocalFile);
// Get the items we're dragging
var items = {};
transferable.getTransferData("zotero/item", items, dataSize);
items.value.QueryInterface(Components.interfaces.nsISupportsString);
var draggedItems = Zotero.Items.get(items.value.data.split(','));
var draggedItems = Zotero.Items.get(this._itemIDs);
var items = [];
// Make sure files exist