Add historyCurrentStep to setHistory event
This commit is contained in:
parent
749609f9a0
commit
7a81bbaec6
3 changed files with 14 additions and 10 deletions
|
@ -261,11 +261,14 @@
|
|||
* @param history Whole history of the editor
|
||||
* @param callback (optional)
|
||||
*/
|
||||
public SetHistory(history: IHistoryState[], callback?: (state: IEditorState) => void) {
|
||||
public SetHistory(
|
||||
{ history, historyCurrentStep }: { history: IHistoryState[], historyCurrentStep?: number},
|
||||
callback?: (state: IEditorState) => void
|
||||
): void {
|
||||
const eventType = 'setHistory';
|
||||
this.app.AddEventListener(eventType, callback);
|
||||
const component = this.GetEditorComponent();
|
||||
component.dispatchEvent(new CustomEvent(eventType, { detail: history }));
|
||||
component.dispatchEvent(new CustomEvent(eventType, { detail: { history, historyCurrentStep }}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue