fix sorting tree condition

This commit is contained in:
Maximilian Krambach 2019-05-14 15:11:25 +02:00
parent ae107dc0d1
commit 71e2ef65fc
1 changed files with 23 additions and 21 deletions

View File

@ -743,8 +743,9 @@ export class SortingTreeComponent<T extends Identifiable & Displayable> implemen
}
// Check if the neighbor below has a level equals to two or more higher than the moved node.
if (nextNeighborBelow) {
if (
(nextNeighborBelow && nextNeighborBelow.level >= nextLevel + 2) ||
nextNeighborBelow.level >= nextLevel + 2 ||
(nextNeighborBelow.level === nextLevel + 1 && nextNeighborBelow.filtered)
) {
let found = false;
@ -767,6 +768,7 @@ export class SortingTreeComponent<T extends Identifiable & Displayable> implemen
verticalMove = Direction.DOWNWARDS;
}
}
}
// Handles the moving upwards
if (verticalMove === Direction.UPWARDS) {