Skip to content
Snippets Groups Projects
Commit e7044d2b authored by rhenck's avatar rhenck
Browse files

DropList: Fix sort list not allowing to drop into itself

#634
parent 9c88909d
No related branches found
No related tags found
No related merge requests found
Pipeline #56348 passed
Allgemein
=========
## editor/2.4.5+player/2.4.5
### Fehlerbehebungen
- Ablegeliste:
- Sortierlisten erlauben wieder Ablegen in die Ausgangsliste
## editor/2.4.4+player/2.4.4
## Änderungen
- Ablegeliste:
......
......@@ -209,13 +209,17 @@ export class DragOperatorService {
DragOperatorService.checkAddForeignItemToCopyList(draggedItem, targetList);
}
/* Only allow drops in other lists, except for sortlists. */
private static checkIsSourceList(sourceList: DropListComponent, targetList: DropListComponent): boolean {
return (sourceList.elementModel.id === targetList.elementModel.id && sourceList.elementModel.isSortList) ||
sourceList.elementModel.id !== targetList.elementModel.id;
}
/* Check list connection, sortlist is an exception since source and target can be the same. */
private static checkConnected(sourceList: DropListComponent, targetList: DropListComponent, ignoreConnection: boolean = false): boolean {
return ignoreConnection || sourceList.elementModel.connectedTo.includes(targetList.elementModel.id);
return ignoreConnection ||
(sourceList.elementModel.id === targetList.elementModel.id && sourceList.elementModel.isSortList) ||
sourceList.elementModel.connectedTo.includes(targetList.elementModel.id);
}
/* Return false, when drop is not allowed */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment