Fix EditorModel clone to actually be useful
This commit is contained in:
parent
fe70e64a40
commit
ddc408690c
1 changed files with 2 additions and 1 deletions
|
@ -91,7 +91,8 @@ export default class EditorModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public clone(): EditorModel {
|
public clone(): EditorModel {
|
||||||
return new EditorModel(this._parts, this._partCreator, this.updateCallback);
|
const clonedParts = this.parts.map(p => this.partCreator.deserializePart(p.serialize()));
|
||||||
|
return new EditorModel(clonedParts, this._partCreator, this.updateCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private insertPart(index: number, part: Part): void {
|
private insertPart(index: number, part: Part): void {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue