Expand all

Dialog

Represents a dialog and the link to open it.

Constructor

new Dialog($container, $openButton) #

Parameters:

Name Type Description
$container jQuery

the element to which the dialog will be appended

$openButton jQuery

the button which opens the dialog. Only used for positioning.

Source:

Properties

$dialog #

Properties:

Name Type Description
$dialog jQuery

The main dialog container

Source:

$downArrow #

Properties:

Name Type Description
$downArrow jQuery

Tip of the dialog pointing to $openButton. Called downArrow for historical reasons although it does not point down anymore.

Source:

$openButton #

Properties:

Name Type Description
$openButton jQuery

The click target which opens the dialog.

Source:

eventPrefix #

Properties:

Name Type Description
eventPrefix string

Prefix specific to the class to be applied to events.

Source:

isOpen #

Properties:

Name Type Description
isOpen boolean

Whether or not the dialog is open.

Source:

Methods

clearWarning() #

Removes the warning ribbon.

Source:
Removes the warning ribbon.

closeDialog() #

Closes a dialog.

Source:
Closes a dialog.

getImageWarnings(image) → {Array.<string>} #

Parameters:

Name Type Description
image ImageModel

Returns:

Type
Array.<string>
Source:

handleOpenCloseClick(openEvent, e) → {boolean} #

Handles click on link that opens/closes the dialog.

Parameters:

Name Type Description
openEvent jQuery.Event

Event object for the mmv-$dialog-open event.

e jQuery.Event

Event object for the click event.

Returns:

False to cancel the default event

Type
boolean
Source:
Handles click on link that opens/closes the dialog.

openDialog() #

Opens a dialog.

Source:
Opens a dialog.

setWarning(content) #

Displays a warning ribbon.

Parameters:

Name Type Description
content string

Content of the warning (can be HTML, setWarning does no escaping).

Source:
Displays a warning ribbon.

showImageWarnings(image) #

Parameters:

Name Type Description
image ImageModel
Source:

startListeningToOutsideClick() #

Sets up the event handler which closes the dialog when the user clicks outside.

Source:
Sets up the event handler which closes the dialog when the user clicks outside.

stopListeningToOutsideClick() #

Removes the event handler set up by startListeningToOutsideClick().

Source:
Removes the event handler set up by startListeningToOutsideClick().

toggleDialog([e]) #

Toggles the open state on the dialog.

Parameters:

Name Type Attributes Description
e jQuery.Event optional

Event object when the close action is caused by a user action, as opposed to closing the window or something.

Source:
Toggles the open state on the dialog.

unattach() #

Clears listeners.

Source:
Clears listeners.