Home Reference Source Test Repository
public class | source

ContextMenu

The context menu html object which reacts to context clicks

Constructor Summary

Public Constructor
public

constructor(ui: UI, mouseHandler: MouseHandler)

Constructor for the context menu class

Member Summary

Public Members
public
public
public
public
public
public
public

ui: *

Method Summary

Public Methods
public

contextmenuEventListener(event: HTMLEvent, x: Number, y: Number)

Function called by canvas when context menu click happens

public

Initializes the listeners for clicks upon the context-menu element

public

repositionMenu(event: HTMLEvent)

Repositions the context menu based on where the click was adjusting for clicks that might place the context menu off screen

public

Public Constructors

public constructor(ui: UI, mouseHandler: MouseHandler) source

Constructor for the context menu class

Params:

NameTypeAttributeDescription
ui UI

reference to the master UI object

mouseHandler MouseHandler

reference to the master mouseHandler object

Public Members

public component: * source

public contextMenu: * source

public isDisplayed: * source

public menuPosX: * source

public menuPosY: * source

public mouseHandler: * source

public ui: * source

Public Methods

public contextmenuEventListener(event: HTMLEvent, x: Number, y: Number) source

Function called by canvas when context menu click happens

Params:

NameTypeAttributeDescription
event HTMLEvent

click event that toggles the context menu opening

x Number

x position of the click event

y Number

y position of the click event

public initListeners() source

Initializes the listeners for clicks upon the context-menu element

public repositionMenu(event: HTMLEvent) source

Repositions the context menu based on where the click was adjusting for clicks that might place the context menu off screen

Params:

NameTypeAttributeDescription
event HTMLEvent

click event that toggles the context menu opening

public toggleContextMenu() source