class
SAPO.Ink.Modal
Version:
0.1
Displays a "window-like" container over the page and waits for dismiss. Can grab its contents from the selector or the markup option. By default the modal measures 600x400, but these dimensions can be overridden by options too. Supports the escape key for dismissal too.
Since:
Defined in
Ink/Modal/1.1/lib.js
October 2012
Constructor Summary
Function Summary
destroy()
removes the modal from the DOM
dismiss()
dismisses the modal
DOMElement
getContentElement()
returns the content DOM element
setContentMarkup
(String
contentMarkup)
replaces the content markup
Constructor Details
constructor Modal
Modal(String|DOMElement
selector, Object
options)
Parameters:
selector
options
-
[ Number width ]
modal width in pixels. defaults to 600 -
[ Number height ]
modal height in pixels. defaults to 400 -
[ Number markup ]
HTML markup string. if passed, populates the modal, otherwise the selector is used to fetch the content. -
[ Function onShow ]
callback to call when the modal is shown -
[ Function onDismiss ]
callback to call when the modal is dismissed -
[ Boolean closeOnClick ]
defaults to false. if trueish, a click anywhere dismissed the modal. -
[ Boolean skipClose ]
defaults to false. if trueish, no X is displayed on the top right corner of the modal (escape still dismissed though)
Function Details
function destroy
destroy()
removes the modal from the DOM
function dismiss
dismiss()
dismisses the modal
function getContentElement
DOMElement
getContentElement()
returns the content DOM element
function setContentMarkup
setContentMarkup(String
contentMarkup)
replaces the content markup
Parameters:
contentMarkup