Add historyCurrentStep to setHistory event

This commit is contained in:
Eric NGUYEN 2022-10-13 16:18:16 +02:00
parent 749609f9a0
commit 7a81bbaec6
3 changed files with 14 additions and 10 deletions

View file

@ -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 }}));
}
/**