commit 704e8ffeea7555499fe7a09d4edd84bf86e54fd9
parent 1b81004a935937ec6c6448e2489ce5ff1876c81a
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 4 Mar 2017 04:17:25 -0500
Fix dragging collections between libraries
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -1811,11 +1811,11 @@ Zotero.CollectionTreeView.prototype.canDropCheckAsync = Zotero.Promise.coroutine
// Dragging a collection to a different library
if (treeRow.ref.libraryID != draggedCollection.libraryID) {
// Disallow if linked collection already exists
- if (yield col.getLinkedCollection(treeRow.ref.libraryID)) {
+ if (yield draggedCollection.getLinkedCollection(treeRow.ref.libraryID)) {
return false;
}
- var descendents = col.getDescendents(false, 'collection');
+ let descendents = draggedCollection.getDescendents(false, 'collection');
for (let descendent of descendents) {
descendent = Zotero.Collections.get(descendent.id);
// Disallow if linked collection already exists for any subcollections
@@ -2023,14 +2023,14 @@ Zotero.CollectionTreeView.prototype.drop = Zotero.Promise.coroutine(function* (r
var newCollection = new Zotero.Collection;
newCollection.libraryID = targetLibraryID;
- yield c.clone(false, newCollection);
+ c.clone(false, newCollection);
if (parentID) {
newCollection.parentID = parentID;
}
var collectionID = yield newCollection.save();
// Record link
- c.addLinkedCollection(newCollection);
+ yield c.addLinkedCollection(newCollection);
// Recursively copy subcollections
if (desc.children.length) {
diff --git a/chrome/content/zotero/xpcom/uri.js b/chrome/content/zotero/xpcom/uri.js
@@ -173,7 +173,7 @@ Zotero.URI = new function () {
* Return URI of collection, which might be a local URI if user hasn't synced
*/
this.getCollectionURI = function (collection) {
- return this._getObjectURI(item);
+ return this._getObjectURI(collection);
}