Uses MicroModal.js library to handle popup functionality. Fetches dynamic content and script on open, and resets on close.
- Source:
Properties:
Name | Type | Description |
---|---|---|
selectors |
object | Set of selectors that can be used to grab popup features. |
states |
object | Set of flags that can be used to toggle various popup states. |
Methods
(inner) focusStates($content)
- Source:
Scroll input elements into view on focus.
Parameters:
Name | Type | Description |
---|---|---|
$content |
element | Popup content wrapper element. |
(inner) hide(modal)
- Source:
Animate out popup when close button or overlay is pressed. Clear popup content if it's dynamic.
Parameters:
Name | Type | Description |
---|---|---|
modal |
element | MicroModal popup element. |
(inner) init()
- Source:
Initializes all MicroModal popups on page. Binds open and close handlers.
(inner) isDisabled(modal)
- Source:
Check if a popup modal has been disabled by a cookie
Parameters:
Name | Type | Description |
---|---|---|
modal |
element | MicroModal popup element. |
(inner) lockPage()
- Source:
Prevent popup from closing when user hits ESC key
(inner) preventEscape(evt)
- Source:
Prevent event propagation to MicroModal when ESC key is hit
Parameters:
Name | Type | Description |
---|---|---|
evt |
event | key down event |
(inner) preventShift(modal)
- Source:
Prevent page layout from shifting when the keyboard is brought forward in Android by input focus.
Parameters:
Name | Type | Description |
---|---|---|
modal |
element | MicroModal popup element. |
(inner) setFocus($content)
- Source:
Focuses in the first input/textarea of the dialog.
Parameters:
Name | Type | Description |
---|---|---|
$content |
element | Popup content wrapper element. |
(inner) show(modal)
- Source:
Animate in popup when it's triggered. Show skeleton UI while dynamically fetching content if necessary. Dynamically fetch associated script if necessary.
Parameters:
Name | Type | Description |
---|---|---|
modal |
element | MicroModal popup element. |
(inner) unlockPage()
- Source:
Allow popup to be closed by user hiting ESC key