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,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;
}
}