Skip to content

Commit

Permalink
Ignore sporadic errors when expanding nested persisted nodes
Browse files Browse the repository at this point in the history
Update #1157
  • Loading branch information
mar10 committed Jun 29, 2024
1 parent 9d512c6 commit 61e233e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/jquery.fancytree.persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@
}
} else {
tree.debug("_loadLazyNodes: " + node + " already loaded.");
node.setExpanded(true, expandOpts);
try {
node.setExpanded(true, expandOpts);
} catch (e) {
// #1157
tree.warn(
"ext-persist: setExpanded failed for " + node,
e
);
}
}
} else {
missingKeyList.push(key);
Expand Down
5 changes: 3 additions & 2 deletions src/jquery.fancytree.table.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
// use the lowest descendant of the preceeding sibling
i = $.inArray(node, siblings);
prev = siblings[i - 1];
_assert(prev.tr);
_assert(prev.tr, "prev.tr missing: " + prev);
// descend to lowest child (with a <tr> tag)
while (prev.children && prev.children.length) {
last = prev.children[prev.children.length - 1];
Expand Down Expand Up @@ -303,7 +303,8 @@
} else {
_assert(
!prevNode.parent,
"prev. row must have a tr, or be system root"
"prev. row must have a tr, or be system root: " +
prevNode
);
// tree.tbody.appendChild(newRow);
insertFirstChild(tree.tbody, newRow); // #675
Expand Down

0 comments on commit 61e233e

Please sign in to comment.