Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContextMenuHandler

Hierarchy

  • ContextMenuHandler

Index

Constructors

constructor

Properties

Private Optional closeContextmenu

closeContextmenu: () => void

Type declaration

    • (): void
    • Returns void

handler

handler: Handler

hide

hide: DebouncedFunc<(Anonymous function)> = debounce(() => {this.closeContextmenu?.();}, 100)

Hide context menu

Private Optional openContextmenu

openContextmenu: (payload: ContextMenuPayload) => void

Type declaration

show

show: DebouncedFunc<(Anonymous function)> = debounce(async (e: MouseEvent, target?: FabricObject) => {if (!this.openContextmenu) {return;}const { onContext } = this.handler;if (!onContext) {return;}const content = await onContext(e, target);if (content === null || content === undefined) {return;}this.openContextmenu({x: e.clientX,y: e.clientY,placement: 'right',content,target: target ?? null,});}, 100)

Show context menu

Methods

bindPortal

destroy

  • destroy(): void
  • Returns void

Generated using TypeDoc