Skip to content

Commit e7c6c49

Browse files
[UXP-242] load all only if selected item
1 parent 70df81a commit e7c6c49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class VocabularyTreeviewService {
159159
}
160160
const parent: TreeviewNode = this.nodeMap.get(item.otherInformation.id)!;
161161
const children = this.nodeMap.get(item.otherInformation.id)!.children || [];
162-
this.getChildrenNodesByParent(item.otherInformation.id, parent.pageInfo, loadAll).subscribe((list: PaginatedList<VocabularyEntryDetail>) => {
162+
this.getChildrenNodesByParent(item.otherInformation.id, parent.pageInfo, (loadAll && selectedItems.length > 0)).subscribe((list: PaginatedList<VocabularyEntryDetail>) => {
163163
if (onlyFirstTime && parent.children!.length > 0 && !loadAll) {
164164
return;
165165
}
@@ -181,7 +181,7 @@ export class VocabularyTreeviewService {
181181
parent.updatePageInfo(newPageInfo);
182182
parent.childrenChange.next(children);
183183

184-
if (!loadAll) {
184+
if (!(loadAll && selectedItems.length > 0)) {
185185
// if not all loaded add a load more button
186186
children.push(new TreeviewNode(LOAD_MORE_NODE, false, newPageInfo, item));
187187
}

0 commit comments

Comments
 (0)