From a61afc89cca0a0022b55bded051b78dfd2478a77 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 16 Apr 2007 13:36:47 +0000 Subject: [PATCH] Addresses #375, Drag and drop file attachments - Fix file drag-and-drop on Windows - Dragging favicon of non-HTML local file now saves as file rather than snapshot --- .../zotero/xpcom/collectionTreeView.js | 48 +++++++++++------ chrome/content/zotero/xpcom/itemTreeView.js | 54 ++++++++++++------- 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 060d52eb2..1c3f2116f 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -712,19 +712,7 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient) this._getItemAtRow(row).ref.addItems(toAdd); } } - else if (dataType == 'text/x-moz-url') { - var url = data.data.split("\n")[0]; - - if (this._getItemAtRow(row).isCollection()) { - var parentCollectionID = this._getItemAtRow(row).ref.getID(); - } - else { - var parentCollectionID = false; - } - - Zotero.Attachments.importFromURL(url, false, false, false, parentCollectionID); - } - else if (dataType == 'application/x-moz-file') { + else if (dataType == 'text/x-moz-url' || dataType == 'application/x-moz-file') { if (this._getItemAtRow(row).isCollection()) { var parentCollectionID = this._getItemAtRow(row).ref.getID(); } @@ -733,15 +721,45 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient) } var unlock = Zotero.Notifier.begin(true); - try { var dataList = dataSet.dataList; for (var i=0, len=dataList.length; i