class SAPO.Ink.Modal
Authors:
jose.p.dias AT co.sapo.pt
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:
October 2012
Defined in Ink/Modal/1.1/lib.js

Constructor Summary
Modal (String|DOMElement selector, Object options)

Function Summary
removes the modal from the DOM
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