Ir al contenido

ContextMenu

Defined in: export/ContextMenu.ts:32

A context menu for a diagram. Right-clicking on a part or the background opens a menu with items.

new ContextMenu(diagram, options): ContextMenu

Defined in: export/ContextMenu.ts:43

Diagram

ContextMenuOptions

ContextMenu

get isMenuOpen(): boolean

Defined in: export/ContextMenu.ts:67

Check if the menu is open.

boolean

close(): void

Defined in: export/ContextMenu.ts:119

Close the context menu.

void


destroy(): void

Defined in: export/ContextMenu.ts:218

Destroy the context menu and clean up.

void


getElement(): HTMLDivElement

Defined in: export/ContextMenu.ts:62

Get the menu DOM element.

HTMLDivElement


getMenuPart(): Part | null

Defined in: export/ContextMenu.ts:72

Get the part the menu was opened on.

Part | null


handleContextMenu(e): void

Defined in: export/ContextMenu.ts:210

Handle a right-click (contextmenu) event.

MouseEvent

void


open(x, y, part): void

Defined in: export/ContextMenu.ts:95

Open the context menu at a screen position.

number

Screen X coordinate.

number

Screen Y coordinate.

Part | null

The part that was right-clicked, or null for background.

void