diff --git a/public/smartcomponent/svg-layout-designer.ts b/public/smartcomponent/svg-layout-designer.ts index 067e96f..c6ccf8b 100644 --- a/public/smartcomponent/svg-layout-designer.ts +++ b/public/smartcomponent/svg-layout-designer.ts @@ -128,6 +128,23 @@ /// App Events /// + /** + * Load an existing editor state and its history + * This is a macro function for + * ReviveEditorState -> SetEditor -> SetHistory + * @param editorState + */ + public LoadEditor(editorState: IEditorState) { + this.ReviveEditorState(editorState, (state) => { + this.SetEditor(state, (currentState) => { + setTimeout(() => { + this.app.Editor.SetHistory({ history: state.history, historyCurrentStep: state.historyCurrentStep }); + }, 200); + }); + }); + } + + /** * Not to be confused with setHistory, * change the default configuration for the new containers, symbols etc.