commit d5fa7be95ac70d3aa39a9b20a0c79b288d0015e8
parent a750203f4fa3a9ade79cc57dde9d96e7f147c899
Author: Simon Kornblith <simon@simonster.com>
Date: Sat, 9 Jun 2012 14:12:27 -0400
Fix import
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -1199,6 +1199,7 @@ Zotero.Translate.Base.prototype = {
deferredProgress[i][1], deferredProgress[i][2]);
}
+ me.newItems = me.newItems.concat(newItems);
me._savingItems--;
me._checkIfDone();
} else {
@@ -1208,8 +1209,10 @@ Zotero.Translate.Base.prototype = {
},
function(attachment, progress, error) {
var attachmentIndex = me._savingAttachments.indexOf(attachment);
- if((progress === false || progress === 100) && attachmentIndex !== -1) {
- me._savingAttachments.splice(attachmentIndex, 1);
+ if(progress === false || progress === 100) {
+ if(attachmentIndex !== -1) {
+ me._savingAttachments.splice(attachmentIndex, 1);
+ }
} else if(attachmentIndex === -1) {
me._savingAttachments.push(attachment);
}
@@ -1231,6 +1234,9 @@ Zotero.Translate.Base.prototype = {
* Checks if saving done, and if so, fires done event
*/
"_checkIfDone":function() {
+ Zotero.debug(this._savingItems);
+ Zotero.debug(this._savingAttachments.length);
+ Zotero.debug(this._currentState);
if(!this._savingItems && !this._savingAttachments.length && !this._currentState) {
this._runHandler("done", true);
}
diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js
@@ -216,7 +216,7 @@ Zotero.Translate.ItemSaver.prototype = {
return topLevelCollection;
},
- "_saveAttachmentFile":function(attachment, parentID) {
+ "_saveAttachmentFile":function(attachment, parentID, attachmentCallback) {
const urlRe = /(([A-Za-z]+):\/\/[^\s]*)/i;
Zotero.debug("Translate: Adding attachment", 4);