Merge pull request #4712 from MaximilianKrambach/fix4711

fix sorting tree condition #4711
This commit is contained in:
Maximilian Krambach 2019-05-14 15:57:39 +02:00 committed by GitHub
commit 6b25e62cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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