commit 311ed7a71db4baa3be462f8ea772e37419513f97
parent b241d3ec528a37f2bbe6ff1bcf3fb577633b92f2
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 26 Apr 2015 16:51:31 -0400
Fix some old-style generators passed to executeTransaction()
And some missing yields
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -1721,7 +1721,7 @@ Zotero.CollectionTreeView.prototype.drop = Zotero.Promise.coroutine(function* (r
// Collection drag between libraries
if (targetLibraryID != droppedCollection.libraryID) {
- yield Zotero.DB.executeTransaction(function () {
+ yield Zotero.DB.executeTransaction(function* () {
function copyCollections(descendents, parentID, addItems) {
for each(var desc in descendents) {
// Collections
@@ -1948,12 +1948,12 @@ Zotero.CollectionTreeView.prototype.drop = Zotero.Promise.coroutine(function* (r
// Otherwise file, so fall through
}
- yield Zotero.DB.executeTransaction(function () {
+ yield Zotero.DB.executeTransaction(function* () {
if (dropEffect == 'link') {
- var itemID = Zotero.Attachments.linkFromFile(file);
+ var itemID = yield Zotero.Attachments.linkFromFile(file);
}
else {
- var itemID = Zotero.Attachments.importFromFile(file, false, targetLibraryID);
+ var itemID = yield Zotero.Attachments.importFromFile(file, false, targetLibraryID);
// If moving, delete original file
if (dragData.dropEffect == 'move') {
try {
diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js
@@ -3079,12 +3079,12 @@ Zotero.ItemTreeView.prototype.drop = Zotero.Promise.coroutine(function* (row, or
// Otherwise file, so fall through
}
- yield Zotero.DB.executeTransaction(function () {
+ yield Zotero.DB.executeTransaction(function* () {
if (dropEffect == 'link') {
- var itemID = Zotero.Attachments.linkFromFile(file, parentItemID);
+ var itemID = yield Zotero.Attachments.linkFromFile(file, parentItemID);
}
else {
- var itemID = Zotero.Attachments.importFromFile(file, parentItemID, targetLibraryID);
+ var itemID = yield Zotero.Attachments.importFromFile(file, parentItemID, targetLibraryID);
// If moving, delete original file
if (dragData.dropEffect == 'move') {
try {