refactor(node-changes): add dragging flag closes #2171

This commit is contained in:
moklick
2022-05-26 18:40:39 +02:00
parent 101f5d25d0
commit b6eb0acb30
6 changed files with 30 additions and 17 deletions
+5 -1
View File
@@ -49,7 +49,7 @@ function applyChanges(changes: any[], elements: any[]): any[] {
if (changes.some((c) => c.type === 'reset')) {
return changes.filter((c) => c.type === 'reset').map((c) => c.item);
}
console.log(changes);
const initElements: any[] = changes.filter((c) => c.type === 'add').map((c) => c.item);
return elements.reduce((res: any[], item: any) => {
@@ -68,6 +68,10 @@ function applyChanges(changes: any[], elements: any[]): any[] {
updateItem.position = currentChange.position;
}
if (typeof currentChange.dragging !== 'undefined') {
updateItem.dragging = currentChange.dragging;
}
if (updateItem.expandParent) {
handleParentExpand(res, updateItem);
}