HTML Tree: fix item deletion breakage when child items are selected.
Closes #2174
This commit is contained in:
parent
873846261e
commit
94c4d975a9
1 changed files with 35 additions and 28 deletions
|
@ -1727,10 +1727,13 @@ var ItemTree = class ItemTree extends LibraryTree {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.selection.selectEventsSuppressed = true;
|
||||||
|
|
||||||
// Collapse open items
|
// Collapse open items
|
||||||
for (var i=0; i<this.rowCount; i++) {
|
for (var i = 0; i < this.rowCount; i++) {
|
||||||
if (this.selection.isSelected(i) && this.isContainer(i)) {
|
if (this.selection.isSelected(i) && this.isContainer(i)) {
|
||||||
this._closeContainer(i, true, true);
|
await this._closeContainer(i, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._refreshRowMap();
|
this._refreshRowMap();
|
||||||
|
@ -1759,6 +1762,10 @@ var ItemTree = class ItemTree extends LibraryTree {
|
||||||
await Zotero.Items.removeFromPublications(ids.map(id => Zotero.Items.get(id)));
|
await Zotero.Items.removeFromPublications(ids.map(id => Zotero.Items.get(id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
this.selection.selectEventsSuppressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getSelectedItems(asIDs) {
|
getSelectedItems(asIDs) {
|
||||||
var items = this.selection ? Array.from(this.selection.selected) : [];
|
var items = this.selection ? Array.from(this.selection.selected) : [];
|
||||||
|
|
Loading…
Reference in a new issue