Jump To:

  1. ui/modal-builder.initializer
  2. ui/modal-builder.setDefaults(options)
  3. ui/modal-builder.init()
  4. ui/modal-builder.buildModal(content, options)
  5. ui/modal-builder~separateDialogOptions(config) ⇒ Object
  6. ui/modal-builder~DefaultModalOptions ⇒ string | string | string

ui/modal-builder

Note this module needs to be initialized before dialogs!

ui/modal-builder.initializer

Modal Builder Component Initializer

Kind: static constant of ui/modal-builder

ui/modal-builder.setDefaults(options)

Kind: static method of ui/modal-builder

Param Type Description
options Object Change options used as default for dialogs, can then be overridden by data attribute settings on element

ui/modal-builder.init()

Initialize everything in document

  • This will only initialize elements once, it is safe to call on page changes

Kind: static method of ui/modal-builder

ui/modal-builder.buildModal(content, options)

Kind: static method of ui/modal-builder

Param Type Description
content Node Content element of the dialog (what is inserted into the body)
options Object Options for built dialog (see defaults)

ui/modal-builder~separateDialogOptions(config) ⇒ Object

Returns JSON string to embed in data-ulu-dialog for dialog handling

Kind: inner method of ui/modal-builder

Param Type Description
config Object Config object to pull dialog specific settings from

ui/modal-builder~DefaultModalOptions ⇒ string | string | string

Default builder options (extends dialog defaults, watch name collisions)

  • Decided to extend defaults so the interface in HTML is singular
  • This is sometimes easier to template (merging and serializing options in twig for example)

Kind: inner typedef of ui/modal-builder
Returns: string - The HTML string for the close icon.string - The HTML string for the resizer icon.string - Markup for the modal.

Param Type Description
template.id string The ID for the new modal.
template.config DefaultModalOptions The resolved modal options.

Properties

Name Type Description
title string | null The title of the modal. Defaults to null.
titleIcon string | null The class name for an icon to display in the title. Defaults to null.
titleClass string Extra class/classes to add to title
nonModal boolean If true, the modal will not prevent interaction with elements behind it. Defaults to false.
documentEnd boolean If true, the modal will be appended to the end of the document.body. Defaults to true.
allowResize boolean If true, the modal will be resizable. Defaults to false.
position "center" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" The initial position of the modal. Defaults to "center".
bodyFills boolean If true, the modal body will fill the available space. Defaults to false.
noBackdrop boolean If true, no backdrop will be displayed behind the modal. Defaults to false.
size "default" | "small" | "large" | "fullscreen" The size of the modal. Defaults to "default".
print boolean If true, the modal content will be optimized for printing. Defaults to false.
noMinHeight boolean If true, the modal will not have a minimum height. Defaults to false.
class string Additional CSS class(es) to add to the modal. Defaults to "".
baseClass string The base CSS class for the modal elements. Defaults to "modal".
classCloseIcon string The class name for the close icon. Uses the wrapped setting string.
classResizerIcon string The class name for the resizer icon. Uses the wrapped setting string.
debug boolean Enables debug logging. Defaults to false.
templateCloseIcon function A function that returns the HTML for the close icon.
templateCloseIcon.config function The resolved modal configuration object.
templateResizerIcon function A function that returns the HTML for the resizer icon.
templateResizerIcon.config function The resolved modal configuration object.
template function The default modal template function.