Class: moopopup

ajs.ui. moopopup

moopopup is a plugin designed to display html content in a draggable, resizable popup window (really a layer over the document). The content shown may be passed as an option, taken from an existing html node or through an ajax request

new moopopup(options)

Layer window user interface.

Parameters:
Name Type Description
options Object The class options object.
Properties
Name Type Argument Default Description
id String <optional>
'moopopup' The identifier (id attribute) of the window.
title String <optional>
null The window title.
width Number <optional>
400 The window width in px.
height Number <optional>
null The window height in px. If null the height depends on the window's content.
top_left_x Number <optional>
null The x coordinate of the top left corner (if not given the window will be centered).
top_left_y Number <optional>
null The y coordinate of the top left corner (if not given the window will be centered).
min_width Number <optional>
300 The minimum width in px when resizing.
min_height Number <optional>
100 The minimum height in px when resizing.
max_body_height Number <optional>
null The maximum height of popoup contents.
draggable Boolean <optional>
true Whether or not the window should be draggable.
resizable Boolean <optional>
true Whether or not the window should be resizable.
overlay Boolean <optional>
true Whether or not to show the window over an overlay which covers the whole viewport.
overlay_click_close_window Boolean <optional>
true Whether or not to close the window when clicking over the overlay.
url String <optional>
null Url used to retrieve window contents through an ajax request.
text String <optional>
null The window content.
html_node String <optional>
null Html node to get the content from.
disable_objects Boolean <optional>
true Whether or not to disable all active objects in the page when sowing the popoup.
onComplete Function <optional>
function(){} Function called when the window is displayed
onClose Function <optional>
function(){} Function called when the window is closed
Source:
Example
 var popup = new ajs.ui.moopopup({
   width: 800,
   max_body_height: 600,
   text: 'My popup content'
 }):

Methods

<protected> checkOptions()

Checks and validates the passed options

Source:
Returns:
void

close()

Closes the window

Source:
Returns:
void

<protected> disableObjects()

Disables all objects in the document

Source:
Returns:
void

display()

Displays the window

Source:
Returns:
void

<protected> enableObjects()

Enables all objects in the document

Source:
Returns:
void

<protected> makeDraggable()

Makes the window draggable

Source:
Returns:
void

<protected> makeResizable()

Makes the window resizable

Source:
Returns:
void

position()

Window repositioning

Source:
Returns:
void

<protected> renderBody()

Renders the window's body

Source:
Returns:
void

<protected> renderContainer()

Renders the window container

Source:
Returns:
void

<protected> renderHeader()

Renders the window's header

Source:
Returns:
void

<protected> renderOverlay()

Renders an overlay over the whole viewport

Source:
Returns:
void

renderPopup()

Renders the window

Source:
Returns:
void

<protected> request()

Performs the ajax request and inserts the content in thw window body

Source:
Returns:
void

<protected> sameDomain(win)

Checks if a window object is in the same domain of current window

Parameters:
Name Type Argument Description
win Object <optional>
the window object
Source:
Returns:
true if the given window is in the same domain, false otherwise

setFocus()

Moves the window to the front

Source:
Returns:
void

<protected> setOption(option, value)

Sets an options

Parameters:
Name Type Argument Description
option String <optional>
The option name
value Mixed <optional>
The option value
Source:
Returns:
void