Modal

Modal

Source:
Parameters:
Name Type Description
element HTMLElement

DOM element for component instantiation and scope

options Object
Properties
Name Type Description
toggleSelector String

Selector for the modal toggle

closeSelector String

Selector for closing the modal

attachClickListener Boolean

Whether or not to bind click events on toggle

attachKeyListener Boolean

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:
Name Type Description
e Event

handleKeyboardGlobal(e)

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

Source:
Parameters:
Name Type Description
e Event

init()

Description:
  • Initialise component.

Source:

openModal()

Description:
  • Open the modal.

Source:

(static) autoInit(root) → {Modal}

Source:
Parameters:
Name Type Description
root HTMLElement

DOM element for component instantiation and scope

Returns:

An instance of Modal.

Type
Modal