Skip to content

WorkspaceLeaf.on('leaf-menu') method

WorkspaceLeaf › on(‘leaf-menu’)

Unofficial

Triggers when context menu action is executed on the leaf.

Signature:

on(name: "leaf-menu", callback: (menu: Menu, leaf: WorkspaceLeaf) => void, ctx?: unknown): EventRef

Parameters:

Parameter Type Description
name "leaf-menu" Should be 'leaf-menu'.
callback (menu: Menu, leaf: WorkspaceLeaf) => void The callback function.
ctx? unknown The context passed as this to the callback function.

Returns: EventRefThe event reference.