Merge pull request #328 from aurimasv/pdfdrop

Add callback to importFromURL for drag-dropped PDFs instead of setTimeout
This commit is contained in:
Simon Kornblith 2014-04-27 21:32:27 -04:00
commit 26ea06524e

View file

@ -3304,15 +3304,11 @@ var ZoteroPane = new function()
var collectionID = false; var collectionID = false;
} }
var attachmentItem = Zotero.Attachments.importFromURL(url, false, false, false, collectionID, mimeType, libraryID); var attachmentItem = Zotero.Attachments.importFromURL(url, false,
false, false, collectionID, mimeType, libraryID,
// importFromURL() doesn't trigger the notifier until function(attachmentItem) {
// after download is complete
//
// TODO: add a callback to importFromURL()
setTimeout(function () {
self.selectItem(attachmentItem.id); self.selectItem(attachmentItem.id);
}, 1001); });
return; return;
} }