Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 5c4ec5a

Browse files
committed
Added support for Fancytree 2.21
1 parent 4872400 commit 5c4ec5a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Resources/assets/js/adapter/fancytree.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,13 @@ export class FancytreeAdapter {
118118
childrenCount++;
119119
}
120120

121-
if (childrenCount) {
121+
if (0 != childrenCount) {
122122
fancytreeNode.folder = true;
123123
fancytreeNode.lazy = true;
124+
125+
if (0 === fancytreeNode.children.length) {
126+
fancytreeNode.children = null;
127+
}
124128
}
125129

126130
return fancytreeNode;
@@ -172,7 +176,7 @@ export class FancytreeAdapter {
172176
result = [result];
173177
}
174178

175-
if (result.length == 1) {
179+
if (result.length == 1 && undefined !== result[0].folder) {
176180
result[0].expanded = true;
177181
}
178182

0 commit comments

Comments
 (0)