new H_ui_window()
ui.js, line 1028
Members
-
_screen_resize_bound
-
True once the screen resize listener is bound: every displayed window has to be brought back on screen when the screen shrinks, and one listener is enough for all of them.
-
close
-
Sets the close button for the modal window.
-
current_open_z_indexnumber
-
Current open z-index for modals.
-
modal
-
Adds or removes the modal mask as needed. if the special_level is not an int but 'err' like error, the z_index += 100 !
-
visible
-
Gets the visibility state of the modal window.
-
zindex
-
Change the zindex for the modal and overlay
Methods
-
staticH_ui_window.bind_screen_resize()
ui.js, line 1071 -
Registers the screen resize reaction once, for every window.
A window dragged near an edge would stay out of the screen after a resize. The handler is registered through H_event (add_resize_handler), which fans the window resize out to every handler in order: a direct window.addEventListener here would be a second, unordered listener next to the one H_event already owns. -
staticH_ui_window.handle_key_press(evt)
ui.js, line 1616 -
Handle key event for all the modal, determine wich modal will receive the event. (generally the last opened)
Name Type Description evtKeyboardEvent -
hide(at_start)
ui.js, line 1467 -
Hides the modal window.
Optionally triggers on_close callback.Name Type Default Description at_startboolean false optional If true, hides at start. -
mutation(records)
ui.js, line 1276 -
Mutation observer callback for modal content changes.
Name Type Description recordsArray Mutation records. -
on_double_click_mask(event)
ui.js, line 1532 -
Handles double click on the modal mask.
Hides the modal.Name Type Description eventEvent The double click event. -
on_key_press(evt)
ui.js, line 1176 -
Handles key press events for the modal.
Closes modal on ESC key.Name Type Description evtKeyboardEvent The keyboard event. -
remove()
ui.js, line 1510 -
Removes the modal window from the DOM.
Cleans up event handlers and observers. -
set_alignment(align_vertical, align_horizontal)
ui.js, line 1296 -
Sets the alignment of the modal window.
The reference frame is the parent node: the page for a window in document.body, the module container for a window living in a module. A container without a box (inactive tab) defers the alignment, see H_ui.realign_windows().Name Type Description align_verticalnumber Vertical alignment. align_horizontalnumber Horizontal alignment. -
set_content(content)
ui.js, line 1189 -
Sets the content of the modal window.
Accepts string, DOM element, or array.Name Type Description contentstring | HTMLElement | Array Content to display. -
set_parent(parentNode, align_horizontal, align_vertical)
ui.js, line 1240 -
Sets the parent node for the modal window.
In document.body the mask keeps the fixed positioning of the theme and covers the page. Anywhere else (a module container) the mask is scoped to that container: it is positioned absolutely on it, so the rest of the page - tabs, hierarchy, other modules - stays reachable, and the window is aligned on the container instead of the viewport.Name Type Description parentNodeHTMLElement Parent node. align_horizontalnumber optional Horizontal alignment. align_verticalnumber optional Vertical alignment. -
set_title(title)
ui.js, line 1212 -
Sets the title of the modal window if it's set in the settings
Accepts string, DOM element, or array.Name Type Description titlestring | HTMLElement | Array Content to display. -
show()
ui.js, line 1486 -
Shows the modal window.
Makes the modal visible and brings it to front. -
toggle()
ui.js, line 1453 -
Toggles the modal window's visibility.
Shows or hides the modal.