Refactor AddContainerToSelectedContainer
This commit is contained in:
parent
d05d0fb196
commit
b1b30e8486
4 changed files with 19 additions and 28 deletions
|
@ -240,20 +240,16 @@ function AppendContainerToSelectedContainer(root: Element | Document,
|
|||
|
||||
const selected = FindContainerById(currentState.containers, currentState.selectedContainerId);
|
||||
|
||||
const newHistory = AddContainerToSelectedContainerAction(
|
||||
type,
|
||||
selected,
|
||||
editorState.configuration,
|
||||
history,
|
||||
editorState.historyCurrentStep
|
||||
);
|
||||
|
||||
if (newHistory === null) {
|
||||
return;
|
||||
if (selected !== null && selected !== undefined) {
|
||||
setNewHistory(AddContainerToSelectedContainerAction(
|
||||
type,
|
||||
selected,
|
||||
editorState.configuration,
|
||||
history,
|
||||
editorState.historyCurrentStep
|
||||
));
|
||||
}
|
||||
|
||||
setNewHistory(newHistory);
|
||||
|
||||
const customEvent = new CustomEvent<IHistoryState>(
|
||||
'appendContainerToSelectedContainer',
|
||||
{ detail: structuredClone(editorState.history[editorState.historyCurrentStep]) });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue