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) {
|
if (containerToReplace === undefined) {
|
||||||
return history;
|
return history;
|
||||||
}
|
}
|
||||||
const containerParent = FindContainerById(current.containers,containerToReplace.properties.parentId);
|
|
||||||
if (containerParent=== undefined) {
|
const containerParent = FindContainerById(current.containers, containerToReplace.properties.parentId);
|
||||||
|
if (containerParent === undefined) {
|
||||||
return history;
|
return history;
|
||||||
}
|
}
|
||||||
const historyAdd = AddContainers(containerParent.children.indexOf(containerId), [{ Type: newContainerId }], containerParent.properties.id, configuration, fullHistory, historyCurrentStep);
|
|
||||||
// Copy des possibles enfants
|
const historyAdd = AddContainers(
|
||||||
if (historyAdd.newContainers[0] === undefined) {
|
containerParent.children.indexOf(containerId),
|
||||||
return history;
|
[{ Type: newContainerId }],
|
||||||
}
|
containerParent.properties.id,
|
||||||
historyAdd.newContainers[0].children = containerToReplace.children;
|
configuration, fullHistory, historyCurrentStep
|
||||||
|
);
|
||||||
|
|
||||||
const historyDelete = DeleteContainer(containerId, historyAdd.history, historyCurrentStep + 1);
|
const historyDelete = DeleteContainer(containerId, historyAdd.history, historyCurrentStep + 1);
|
||||||
const currentDelete = historyDelete[historyDelete.length - 1];
|
const currentDelete = historyDelete[historyDelete.length - 1];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue