Fix inability to drag subcollection to top level within group library
HTML tree regression Fixes #2201
This commit is contained in:
parent
c5067edd2d
commit
aeabe0b3f6
1 changed files with 2 additions and 8 deletions
|
@ -1372,13 +1372,14 @@ var CollectionTree = class CollectionTree extends LibraryTree {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (dataType == 'zotero/collection') {
|
else if (dataType == 'zotero/collection') {
|
||||||
if (!treeRow.isLibrary() && !treeRow.isCollection()) {
|
if (!treeRow.isLibrary(true) && !treeRow.isCollection()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let draggedCollectionID = data[0];
|
let draggedCollectionID = data[0];
|
||||||
let draggedCollection = Zotero.Collections.get(draggedCollectionID);
|
let draggedCollection = Zotero.Collections.get(draggedCollectionID);
|
||||||
|
|
||||||
|
// Dragging within same library
|
||||||
if (treeRow.ref.libraryID == draggedCollection.libraryID) {
|
if (treeRow.ref.libraryID == draggedCollection.libraryID) {
|
||||||
// Collections cannot be dropped on themselves
|
// Collections cannot be dropped on themselves
|
||||||
if (draggedCollectionID == treeRow.ref.id) {
|
if (draggedCollectionID == treeRow.ref.id) {
|
||||||
|
@ -1390,13 +1391,6 @@ var CollectionTree = class CollectionTree extends LibraryTree {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Dragging a collection to a different library
|
|
||||||
else {
|
|
||||||
// Allow cross-library drag only to root library and collections
|
|
||||||
if (!treeRow.isLibrary(true) && !treeRow.isCollection()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue