Add callback to importFromURL for drag-dropped PDFs instead of setTimeout

This commit is contained in:
Aurimas Vinckevicius 2013-05-21 21:55:49 -05:00
parent 311e6f2fa7
commit cf5d3a08bf

View file

@ -3283,16 +3283,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;
}
}