Merge pull request #4618 from GabrielInTheWorld/tree-sort-agenda

Fixes showing the arrow to expand.
This commit is contained in:
Finn Stutzenstein 2019-04-24 10:38:51 +02:00 committed by GitHub
commit 7a00f26537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -708,7 +708,7 @@ export class SortingTreeComponent<T extends Identifiable & Displayable> implemen
if (node.level > 0) { if (node.level > 0) {
// const previousNode = this.osTreeData[previousIndex - 1]; // const previousNode = this.osTreeData[previousIndex - 1];
const previousNode = this.getNextVisibleNode(this.osTreeData[previousIndex - 1], Direction.UPWARDS); const previousNode = this.getNextVisibleNode(this.osTreeData[previousIndex - 1], Direction.UPWARDS);
const onlyChild = this.getChildNodes(previousNode).length === 1; const onlyChild = this.getUnfilteredChildNodes(previousNode).length === 1;
const isMovedLowerLevel = previousIndex === nextIndex && nextLevel <= previousNode.level && onlyChild; const isMovedLowerLevel = previousIndex === nextIndex && nextLevel <= previousNode.level && onlyChild;
const isMovedAway = previousIndex !== nextIndex && onlyChild; const isMovedAway = previousIndex !== nextIndex && onlyChild;