Class: H_ui_prompt

H_ui_prompt

UI class for prompt dialogs and confirmation popups.
Extends H_ui_window.
Handles buttons, keypress, and cleanup.
Possible settings for H_ui_prompt:
- content: string|HTMLElement|Array (content to display in the prompt)
- contentClass: string (optional, CSS class for the content area)
- fields: object (optional, additional fields to pass to handlers)
- buttons: array of button settings, each with:
- label: string (button text)
- css: string (optional, additional CSS classes)
- handler: function(fields, dom_element) (callback on click)
- keyPress: string|array (key(s) to trigger this button, e.g. 'Enter', 'Escape')
- cancel_handler: function (optional, handler for cancel action)
- modal: boolean (default true, show as modal)
- disable_background_click: boolean (default false)
- special: boolean (default true, special modal)
- special_level: number (default 1)
- remove_on_close: boolean (remove from DOM when closed)
Used as h.libs.ui_prompt.

new H_ui_prompt()

ui.js, line 1669

Methods

clean()

ui.js, line 1761
Cleans up the prompt dialog.
Removes event listeners and DOM elements.

hide_buttons(event)

ui.js, line 1784
Hides the prompt buttons.
Name Type Description
event Event The event.

on_click_button(event)

ui.js, line 1749
Handles click events on prompt buttons.
Name Type Description
event Event The mouse event.

on_key_press(event)

ui.js, line 1772
Handles key press events for prompt buttons.
Name Type Description
event Event The keyboard event.

show_buttons(event)

ui.js, line 1792
Shows the prompt buttons.
Name Type Description
event Event The event.