mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-10 04:46:33 +00:00
Fixed Open Button
Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
parent
c88d8dd17b
commit
6e0a0a19c5
@ -232,8 +232,8 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
|
||||
registry.registerCommand(ArduinoCommands.SHOW_OPEN_CONTEXT_MENU, {
|
||||
isVisible: widget => this.isArduinoToolbar(widget),
|
||||
isEnabled: widget => this.isArduinoToolbar(widget),
|
||||
execute: async (widget: Widget, event: React.MouseEvent<HTMLElement>) => {
|
||||
const el = (event.target as HTMLElement).parentElement;
|
||||
execute: async (widget: Widget, target: EventTarget) => {
|
||||
const el = (target as HTMLElement).parentElement;
|
||||
if (el) {
|
||||
this.contextMenuRenderer.render(ArduinoToolbarContextMenu.OPEN_SKETCH_PATH, {
|
||||
x: el.getBoundingClientRect().left,
|
||||
|
@ -103,7 +103,7 @@ export class ArduinoToolbar extends ReactWidget {
|
||||
protected executeCommand = (e: React.MouseEvent<HTMLElement>) => {
|
||||
const item = this.items.get(e.currentTarget.id);
|
||||
if (TabBarToolbarItem.is(item)) {
|
||||
this.commands.executeCommand(item.command, this, e);
|
||||
this.commands.executeCommand(item.command, this, e.target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user