commit 26ea06524e5dfb113f212ba617b6cc990369f2c4
parent 35fe6490feb38d80c3322b89591c9021181ea700
Author: Simon Kornblith <simon@simonster.com>
Date: Sun, 27 Apr 2014 21:32:27 -0400
Merge pull request #328 from aurimasv/pdfdrop
Add callback to importFromURL for drag-dropped PDFs instead of setTimeout
Diffstat:
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -3304,16 +3304,12 @@ var ZoteroPane = new function()
var collectionID = false;
}
- var attachmentItem = Zotero.Attachments.importFromURL(url, false, false, false, collectionID, mimeType, libraryID);
-
- // importFromURL() doesn't trigger the notifier until
- // after download is complete
- //
- // TODO: add a callback to importFromURL()
- setTimeout(function () {
- self.selectItem(attachmentItem.id);
- }, 1001);
-
+ var attachmentItem = Zotero.Attachments.importFromURL(url, false,
+ false, false, collectionID, mimeType, libraryID,
+ function(attachmentItem) {
+ self.selectItem(attachmentItem.id);
+ });
+
return;
}
}