Add doAction API call for ModelView (#10345)

* Add doAction API call for ModelView

* cleanup
This commit is contained in:
Charles Gagnon
2020-05-12 10:47:20 -07:00
committed by GitHub
parent ff848b5903
commit 3fa0deed71
13 changed files with 70 additions and 8 deletions

View File

@@ -266,6 +266,10 @@ export abstract class ComponentBase extends Disposable implements IComponent, On
(<HTMLElement>this._el.nativeElement).focus();
}
public doAction(action: string, ...args: any[]): void {
// no-op, components should override this if they want to handle actions
}
protected onkeydown(domNode: HTMLElement, listener: (e: StandardKeyboardEvent) => void): void {
this._register(addDisposableListener(domNode, EventType.KEY_DOWN, (e: KeyboardEvent) => listener(new StandardKeyboardEvent(e))));
}