Fix some old-style generators passed to executeTransaction()

And some missing yields
This commit is contained in:
Dan Stillman 2015-04-26 16:51:31 -04:00
parent b241d3ec52
commit 311ed7a71d
2 changed files with 7 additions and 7 deletions

View file

@ -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 {

View file

@ -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 {