Class: H_ui_context_menu

H_ui_context_menu

Creates an instance of H_ui_context_menu.
a custom UI context menu with dynamic buttons. Possible settings:
- buttons (Array): List of button elements to include in the menu
- open_callback (string|function): Function name to call when menu opens
- hide_callback (string|function): Function name to call when menu hides
- class (string): Additional CSS class for styling
Used as h.libs.ui.contex_menu

new H_ui_context_menu(dom_id, settings)

ui.js, line 2616
Name Type Description
dom_id string The DOM element ID for the menu container.
settings Object Configuration object for the context menu.

Members

instancesObject

Stores all context_menu instances.

Methods

clean()

ui.js, line 2748
Sarah connord ?

exist(){boolean}

ui.js, line 2741
Still alive ?
Returns:
Type Description
boolean true if it's the case

hide()

ui.js, line 2709
Hides the context menu.
Triggers the hide callback.

hide_child(evt)

ui.js, line 2730
Hide the child of the current evt.target
Name Type Description
evt Event The click event on the item.

open(evt)

ui.js, line 2657
Opens the context menu at the event's position.
Triggers the open callback if defined.
Name Type Description
evt Event The event triggering the context menu.

toggle_child(evt)

ui.js, line 2719
Toggles the visibility of a child menu when a parent button is clicked.
Name Type Description
evt Event The click event on the parent menu item.

staticH_ui_context_menu.clean_instances()

ui.js, line 2779
Sarah connord family ?

staticH_ui_context_menu.create_instance(dom_id, settings){H_ui_context_menu}

ui.js, line 2764
Creates a new context_menu instance for a given dom_id.
Cleans up any existing instance for the same dom_id.
Name Type Description
dom_id string The DOM id suffix.
settings Object Settings for the instance.
Returns:
Type Description
H_ui_context_menu The created instance.