Merge pull request #328 from aurimasv/pdfdrop
Add callback to importFromURL for drag-dropped PDFs instead of setTimeout
This commit is contained in:
commit
26ea06524e
1 changed files with 6 additions and 10 deletions
|
@ -3304,15 +3304,11 @@ 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 () {
|
||||
var attachmentItem = Zotero.Attachments.importFromURL(url, false,
|
||||
false, false, collectionID, mimeType, libraryID,
|
||||
function(attachmentItem) {
|
||||
self.selectItem(attachmentItem.id);
|
||||
}, 1001);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue