Remove children replacement
This commit is contained in:
parent
9aec5ae751
commit
65ca7fa10c
1 changed files with 10 additions and 8 deletions
|
@ -158,16 +158,18 @@ export function ReplaceByContainer(
|
|||
if (containerToReplace === undefined) {
|
||||
return history;
|
||||
}
|
||||
|
||||
const containerParent = FindContainerById(current.containers, containerToReplace.properties.parentId);
|
||||
if (containerParent === undefined) {
|
||||
return history;
|
||||
}
|
||||
const historyAdd = AddContainers(containerParent.children.indexOf(containerId), [{ Type: newContainerId }], containerParent.properties.id, configuration, fullHistory, historyCurrentStep);
|
||||
// Copy des possibles enfants
|
||||
if (historyAdd.newContainers[0] === undefined) {
|
||||
return history;
|
||||
}
|
||||
historyAdd.newContainers[0].children = containerToReplace.children;
|
||||
|
||||
const historyAdd = AddContainers(
|
||||
containerParent.children.indexOf(containerId),
|
||||
[{ Type: newContainerId }],
|
||||
containerParent.properties.id,
|
||||
configuration, fullHistory, historyCurrentStep
|
||||
);
|
||||
|
||||
const historyDelete = DeleteContainer(containerId, historyAdd.history, historyCurrentStep + 1);
|
||||
const currentDelete = historyDelete[historyDelete.length - 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue