mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-20 19:14:10 +01:00
actionbar: pass in event as part of the context
This commit is contained in:
@@ -135,7 +135,14 @@ export class BaseActionItem extends EventEmitter implements IActionItem {
|
||||
|
||||
public onClick(event: Event): void {
|
||||
DOM.EventHelper.stop(event, true);
|
||||
const context = (this._context === null || this._context === undefined) ? event : this._context;
|
||||
let context: any;
|
||||
if (types.isUndefinedOrNull(this._context)) {
|
||||
context = event;
|
||||
} else {
|
||||
context = this._context;
|
||||
context.event = event;
|
||||
}
|
||||
|
||||
this._actionRunner.run(this._action, context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user