itemTree: handle restoring child item from trash in notify (#4796)
If a child item is restored from the trash and its parent row exists and is open, collapse the parent row and expand it to re-render child items. Fixes: #4791
This commit is contained in:
parent
56ae6d9793
commit
f824741d07
1 changed files with 10 additions and 0 deletions
|
@ -705,6 +705,16 @@ var ItemTree = class ItemTree extends LibraryTree {
|
|||
sort = id;
|
||||
}
|
||||
}
|
||||
// If a trashed child item is restored while its parent's row is expanded,
|
||||
// collapse and re-open the parent to have that child item row added.
|
||||
else {
|
||||
let parentItemRowIndex = this.getRowIndexByID(item.parentItemID);
|
||||
if (parentItemRowIndex === false) continue;
|
||||
if (this.isContainerOpen(parentItemRowIndex)) {
|
||||
this.toggleOpenState(parentItemRowIndex, true);
|
||||
await this.toggleOpenState(parentItemRowIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sort && ids.length != 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue