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 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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue