Add LoadEditor to smart component

This commit is contained in:
Eric NGUYEN 2022-10-14 13:46:42 +02:00
parent 7a59c23d20
commit 49e051059e

View file

@ -128,6 +128,23 @@
/// App Events /// /// 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, * Not to be confused with setHistory,
* change the default configuration for the new containers, symbols etc. * change the default configuration for the new containers, symbols etc.