Add LoadEditor to smart component
This commit is contained in:
parent
7a59c23d20
commit
49e051059e
1 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue