documentation

Documentation generator: JsDoc Toolkit 2.4.0
Template: Wink 1.0
Generated on:

Class wink.ui.xy.Popup

Popup is a singleton that allows to open a popup window with one (alert) or two buttons (confirm) or with a fully customizable content Options are available for each type of popup style

Class Summary
Constructor Attributes Constructor Name and Description
 
Compatibility
Compatibility list Supported platforms / browsers
iOS2, iOS3, iOS4, iOS5, iOS6, Android 1.1, Android 1.5, Android 2.1, Android 2.2, Android 2.3, Android 3.0, Android 3.1, Android 4.0, BlackBerry 6, BlackBerry 7, Bada 1.0, Windows Phone 7.5, Windows Phone 8

Method Summary

Class Detail

wink.ui.xy.Popup()
var popup = new wink.ui.xy.Popup();

document.body.appendChild(popup.getDomNode());

popup.confirm(
{
	msg: "Do you confirm ?",
	callbackOk: { context: window, method: 'confirmOk' },
	callbackCancel: { context: window, method: 'confirmCancel' }
});
See:
Test page
Test page (add to homescreen)

Field Detail

{boolean} displayed
Indicates whether the Popup is displayed
{integer} uId
Unique identifier

Method Detail

  • alert(options)
    Opens a 1-button popup with a message. calls a callback function if asked when the button is clicked
    Parameters:
    {object} options
    The options object
    {string} options.msg
    The message to display
    {string} options.btn
    The text to display in the button. If nothing specified, the default translation is used
    {object|function} options.callback
    The callback to invoke when the user clicks on the button
    {boolean} options.borderRadius
    Indicates whether the popup must be displayed with border-radius style
    {integer} options.duration
    The duration of the display transition
    {boolean} options.followScrollY
    Allows to follow the scroll on y-axis
  • confirm(options)
    Opens a 2-buttons popup with a message. calls a callback function if asked, depending on the clicked button
    Parameters:
    {object} options
    The options object
    {string} options.msg
    The message to display
    {string} options.btnCancel
    The text to display in the "cancel" button. If nothing specified, the default translation is used
    {object|function} options.callbackCancel
    The callback to invoke when the user clicks on the 'cancel' button { context, method }
    {string} options.btnOk
    The text to display in the "ok" button. If nothing specified, the default translation is used
    {object|function} options.callbackOk
    The callback to invoke when the user clicks on the 'ok' button { context, method }
    {boolean} options.borderRadius
    Indicates whether the popup must be displayed with border-radius style
    {integer} options.duration
    The duration of the display transition
    {boolean} options.followScrollY
    Allows to follow the scroll on y-axis
  • {HTMLElement} getDomNode()
    Returns the Popup dom node
    Returns:
    {HTMLElement} The main dom node
  • hide()
    Hides the Popup
  • Opens a fully customizable popup
    Parameters:
    {object} options
    The options object
    {string|HTMLElement} options.content
    The HTML code of the content or a dom node
    {string} options.arrow
    The position of the arrow, if needed, values: "top", "bottom", "none" (default value)
    {integer|string} options.top
    The top position of the window
    {HTMLElement} options.targetNode
    The node pointed by the arrow (top is then ignored)
    {integer|string} options.arrowLeftPos
    The left-position of the arrow
    {boolean} options.borderRadius
    Indicates whether the popup must be displayed with border-radius style
    {integer} options.duration
    The duration of the display transition
    {boolean} options.followScrollY
    Allows to follow the scroll on y-axis
    {object|function} options.layerCallback
    The callback invoked when the user click on the layer, if not specified the default action is the popup hiding
  • preloadContent()
    Deprecated:
    This method is no longer needed
    Since:
    1.2.0