Creates a new (empty) container for a modal overlay. A modal overlay is an overlay that blocks the content
below it. To remove the modal overlay, use PrimeFaces.utils.removeModal
.
An overlay widget instance.
The modal overlay element should be a DIV.
A supplier function that return a list of tabbable elements. A tabbable element is an element to which the user can navigate to via the tab key.
The DOM element for the newly added modal overlay container.
An overlay widget is moved in the DOM to the position as specified by the appendTo
attribute. This function
moves the widget to its position in the DOM and removes old elements from previous AJAX updates.
The overlay widget instance.
The DOM element for the overlay.
ID of the overlay, usually the widget ID.
The container to which the overlay is appended.
Blocks the enter key for an event like keyup
or keydown
. Useful in filter input events in many
components.
The key event that occurred.
true
if ENTER key was blocked, false if not.
Calculates an element offset relative to the current scroll position of the window.
An element for which to calculate the scroll position.
The offset of the given element, relative to the current scroll position of the window.
Cleanup the detached
overlay.
If you update a component, the overlay is rendered as specified in the component tree (XHTML view), but moved to a different container via JavaScript.
This means that after an AJAX update, we now have 2 overlays with the same id:
appendTo
attributeWe now need to remove the detached overlay. This is done by this function.
The (old) overlay widget instance.
The DOM element for the overlay.
ID of the overlay, usually the widget ID.
The container to which the overlay is appended.
Count the bytes of the inputtext. borrowed from the ckeditor wordcount plugin
Text to count bytes from.
the byte count
Decode escaped XML into regular string.
the input to check if filled
either the original string or escaped XML
When configuring numeric value like 'showDelay' and the user wants '0' we can't treat 0 as Falsey so we make the value 0. Otherwise Falsey returns the default value.
the original value
the required default value if value is not set
the calculated value
Disables CSS and jQuery animation.
Disables a button from being clicked.
a required jQuery button to disable
Enables CSS and jQuery animation.
Enables a button.
a required jQuery element to enable
Enables scrolling again if previously disabled via PrimeFaces.utils.preventScrolling
.
Enables navigating to an element via the tab key outside an overlay widget. Usually called when a modal
overlay is removed. This reverts the changes as made by PrimeFaces.utils.preventTabbing
.
A modal overlay widget instance.
ID of a modal overlay, usually the widget ID.
Exclude elements such as buttons, links, inputs from being touch swiped. Users can always add
class="noSwipe"
to any element to exclude it as well.
A CSS selector for the elements to be excluded from being touch swiped.
Formats the allowTypes regex pattern in a more human-friendly format.
The allowTypes regex pattern to format
The allowTypes formatted in a more human-friendly format.
Formats the given data size in a more human-friendly format, e.g., 1.5 MB
etc.
File size in bytes to format
The given file size, formatted in a more human-friendly format.
Finds scrollable parents (not the document).
An element used to find its scrollable parents.
the list of scrollable parents.
Is this component wrapped in a float label?
An element to check if wrapped in float label.
true this this JQ has a float label parent
Ignores unprintable keys on filter input text box. Useful in filter input events in many components.
The key event that occurred.
true
if the one of the keys to ignore was pressed, or false
otherwise.
Is this SPACE or ENTER key. Used throughout codebase to trigger and action.
The key event that occurred.
true
if the key is an action key, or false
otherwise.
Checks if the key pressed is cut, copy, or paste.
The key event that occurred.
true
if the key is cut/copy/paste, or false
otherwise.
Is this CMD on MacOs or CTRL key on other OSes.
The key event that occurred.
true
if the key is a meta key, or false
otherwise.
Checks if a modal with the given ID is currently displayed.
The base ID of a modal overlay, usually the widget ID.
Whether the modal with the given ID is displayed.
Checks if the key pressed is a printable key like 'a' or '4' etc.
The key event that occurred.
true
if the key is a printable key, or false
otherwise.
Is this scrollable parent a type that should be bound to the window element.
An element to check if should be bound to window scroll.
true this this JQ should be bound to the window scroll event
Killswitch that kills all AJAX requests, running Pollers and IdleMonitors.
Helper to open a new URL and if CTRL is held down open in new browser tab.
The click event that occurred.
The URL anchor link that was clicked.
Prevents the user from scrolling the document BODY element. You can enable scrolling again via
PrimeFaces.utils.enableScrolling
.
Given a modal overlay, prevents navigating via the tab key to elements outside of that modal overlay. Use
PrimeFaces.utils.enableTabbing
to restore the original behavior.
An overlay widget instance.
ID of a modal overlay widget.
The z-index of the modal overlay.
A supplier function that return a list of tabbable elements. A tabbable element is an element to which the user can navigate to via the tab key.
Queue a microtask if delay is 0 or less and setTimeout if > 0.
the function to call after the delay
the optional delay in milliseconds
the id associated to the timeout or undefined if no timeout used
CSS Transition method for overlay panels such as SelectOneMenu/SelectCheckboxMenu/Datepicker's panel etc.
An element for which to execute the transition.
Class name used for transition phases.
Two handlers named show
and hide
that should be invoked
when the element gets shown and hidden. If the given element or className property is undefined
or null
,
this function returns null
.
Registers a callback that is invoked when a scroll event is triggered on The DOM element for the widget that has a connected overlay.
A widget instance for which to register a scroll handler.
A scroll event with a namespace, such as scroll.widgetId
.
A DOM element used to find scrollable parents.
A callback that is invoked when a scroll event occurs on the widget.
unbind callback handler
Sets up an overlay widget. Appends the overlay widget to the element as specified by the appendTo
attribute. Also makes sure the overlay widget is handled properly during AJAX updates.
An overlay widget instance.
The DOM element for the overlay.
The ID of the overlay, usually the widget ID.
The overlay that was passed to this function.
Registers a callback on the document that is invoked when the user clicks on an element outside the overlay widget.
An overlay widget instance.
A click event with a namespace to listen to, such as mousedown.widgetId
.
The DOM element for the overlay.
The callback which
resolves the elements to ignore when the user clicks outside the overlay. The hideCallback
is not invoked
when the user clicks on one those elements.
A callback that is invoked when the user clicks on an element outside the overlay widget.
Unbind callback handler
Registers a callback that is invoked when the window is resized.
A widget instance for which to register a resize handler.
A resize event with a namespace to listen to, such as resize.widgetId
.
An element that prevents the callback from being invoked when it is not visible, usually a child element of the widget.
A callback that is invoked when the window is resized.
Optional CSS selector. If given, the callback is invoked only when the resize event is triggered on an element the given selector.
Unbind callback handler
Registers a callback that is invoked when a scroll event is triggered on the DOM element for the widget.
A widget instance for which to register a scroll handler.
A scroll event with a namespace, such as scroll.widgetId
.
A callback that is invoked when a scroll event occurs on the widget.
unbind callback handler
Removes the overlay from the overlay container as specified by the appendTo
attribute.
The overlay widget instance.
The (new) DOM element of the overlay.
ID of the the overlay, usually the widget ID.
The container to which the overlay is appended.
Given a modal overlay widget, removes the modal overlay element from the DOM. This reverts the changes as
made by PrimeFaces.utils.addModal
.
A modal overlay widget instance.
The modal overlay element should be a DIV.
Finds the element to which the overlay panel should be appended. If none is specified explicitly, append the panel to the body.
A widget that has a panel to be appended.
The DOM element that is the target of this overlay
The DOM element for the overlay.
The search expression for the element to which the overlay panel should be appended.
Finds the container element to which an overlay widget should be appended. This is either the element
specified by the widget configurations's appendTo
attribute, or the document BODY element otherwise.
A widget to be displayed as an overlay.
The container DOM element to which the overlay is to be appended.
This method concatenates the classes into a string according to the condition of the arguments and returns it.
class
Removes a scroll handler as registered by PrimeFaces.utils.registerScrollHandler
.
A widget instance for which a scroll handler was registered.
A scroll event with a namespace, such as scroll.widgetId
.
Handles floating label CSS if wrapped in a floating label.
the to add the CSS classes to
the input(s) to check if filled
true if this is wrapped in a floating label
Generated using TypeDoc
The object with various utilities needed by PrimeFaces.