Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IContextMenuItem

The options for a item in a Context Menu. It encapsulates the jquery-context-menu option.

Hierarchy

  • IContextMenuItem

Index

Properties

childItems

childItems: IContextMenuItem[]

Child items

These are displayed on the right when a user hovers over this item

disabled

disabled: boolean

When set to true this will disable and gray out the item

icon

icon: string

The name of the icon that will display for the item

onBuildCallback

onBuildCallback: function

Callback invoked when the IContextMenu is built

The item will not show up in the IContextMenu if this returns null. Use this callback to decide when to show the item in the menu, or change components of the option on the fly. For instance, you could disable the item on specific conditions. The callback will have access to some useful data on reviewData like documentId or workspaceId. It will also have access to the full public API.

Type declaration

onClickCallback

onClickCallback: function

Callback invoked when the item is clicked

The callback will have access to some useful data on reviewData like documentId or workspaceId. It will also have access to the full public API.

Type declaration

order

order: number

Order in the list of context menu items

Optional permissionCheck

permissionCheck: IPermissionCheckRequest

Permission check object

text

text: string

The text that will display for the item

Methods

getOptions

  • Gets back the JQuery Options to be used in the jquery-context-menu build().

    Parameters

    • triggerElement: any

      Name of the element that triggered the build()

    • event: any

      The event data from jquery-context-menu build()

    • reviewData: IContextMenuReviewData

      Useful data that will be included for onClick and onBuild of the menu.

    • api: IReviewInterfaceApi

      The public api that will be included for onClick and onBuild of the menu.

    • logger: Logger

      The logger to use when encountering errors when building menus.

    Returns ContextMenuOption

    The context menu options in a format usable for jquery-context-menu build()