Module: modal_js

Methods

(inner) _modalClose(obj, close) → {boolean}

Handles the save/apply jsonrpc response for a modal
Parameters:
Name Type Description
obj object jsonrpc response
close boolean close the modal if there is no error?
Source:
Returns:
true on close, else false
Type
boolean

(inner) cleanupModal(el) → {void}

Removes all invalid indicators and warning messages from a modal pointed by el.
Parameters:
Name Type Description
el Element the modal element
Source:
Returns:
Type
void

(inner) cleanupModalId(id) → {void}

Removes all invalid indicators and warning messages from a modal with the given id.
Parameters:
Name Type Description
id string id of the modal
Source:
Returns:
Type
void

(inner) focusFirstInput(container) → {void}

Sets the focus to the first input or select element
Parameters:
Name Type Description
container EventTarget | Element the parent of the elements
Source:
Returns:
Type
void

(inner) getOpenModal() → {Element}

Gets the currently opened modal
Source:
Returns:
the opened modal or null if no modal is opened
Type
Element

(inner) modalApply(obj) → {boolean}

Handles the apply jsonrpc response for a modal Shows the possible error and leaves the modal open
Parameters:
Name Type Description
obj object jsonrpc response
Source:
Returns:
true on close, else false
Type
boolean

(inner) modalClose(obj) → {boolean}

Handles the save/apply jsonrpc response for a modal Shows the possible error or closes the modal
Parameters:
Name Type Description
obj object jsonrpc response
Source:
Returns:
true on close, else false
Type
boolean

(inner) openModal(modal) → {void}

Opens a modal
Parameters:
Name Type Description
modal string name of the modal
Source:
Returns:
Type
void

(inner) populateEntities(id, entities) → {void}

Populates the entities element
Parameters:
Name Type Description
id string element id
entities Array array with entities to add
Source:
Returns:
Type
void

(inner) showConfirm(text, btnText, callback) → {void}

Shows a confirmation modal
Parameters:
Name Type Description
text string text to show (already translated)
btnText string text for the yes button (already translated)
callback function callback function on confirmation
Source:
Returns:
Type
void

(inner) showConfirmInline(el, text, btnText, callback) → {void}

Shows an inline confirmation (for open modals)
Parameters:
Name Type Description
el Element | ChildNode parent element to add the confirmation dialog
text string text to show (already translated)
btnText string text for the yes button (already translated)
callback function callback function on confirmation
Source:
Returns:
Type
void