Modal

Modal

Source:
Parameters:
NameTypeDescription
elementHTMLElement

DOM element for component instantiation and scope

optionsObject
Properties
NameTypeDescription
toggleSelectorString

Selector for the modal toggle

closeSelectorString

Selector for closing the modal

attachClickListenerBoolean

Whether or not to bind click events on toggle

attachKeyListenerBoolean

Whether or not to bind keyboard events

Classes

Modal

Methods

checkScroll()

Description:
  • Check if there is a scroll and display overflow.

Source:

closeModal()

Description:
  • Close the modal.

Source:

destroy()

Description:
  • Destroy component.

Source:

handleClickOnToggle(e)

Description:
  • Toggles between collapsed/expanded states.

Source:
Parameters:
NameTypeDescription
eEvent

handleKeyboardGlobal(e)

Description:
  • Handles global keyboard events, triggered outside of the modal.

Source:
Parameters:
NameTypeDescription
eEvent

init()

Description:
  • Initialise component.

Source:

openModal()

Description:
  • Open the modal.

Source:

(static) autoInit(root) → {Modal}

Source:
Parameters:
NameTypeDescription
rootHTMLElement

DOM element for component instantiation and scope

Returns:

An instance of Modal.

Type
Modal