Modal

The Modal Class provides properties, methods, and events to interface with the HTML tags generated by the <silk:Modal> tag.

Kind: global class

Properties

Name
Type
Description

$modal

Object

jQuery object referencing to the modal HTML tag.

$header

Object

jQuery object referencing to the modal's header HTML tag.

$body

Object

jQuery object referencing to the modal's body HTML tag.

$footer

Object

jQuery object referencing to the modal's footer HTML tag.

Methods and Event

new Modal(id)

Returns a Modal instance.

Param
Type
Description

id

String

Modal's name or unique identifier.

close()

Closes the modal dialgo. Similar to hide.

Kind: instance method of Modal

getTitle()

Gets the title of the modal dialog.

Kind: instance method of Modal

hide()

Hides the modal dialog.

Kind: instance method of Modal

on

Extends the "on" method from the eventManager Class.

Kind: instance property of Modal

Param
Type
Description

eventName

String

The event's name.

eventFunction

function

The function to be triggered.

open()

Opens the modal dialgo. Similar to show.

Kind: instance method of Modal

setBody(content)

Sets the HTML content of the modal dialog.

Kind: instance method of Modal

Param
Type
Description

content

String

The new content in HTML format.

setTitle(title)

Sets the header title of the modal dialog.

Kind: instance method of Modal

Param
Type
Description

title

String

The new modal's header title.

show()

Shows or opens the modal dialog.

Kind: instance method of Modal

on:beforeShow

Event triggered before the Modal is showed. Created with the Modal.on("beforeShow", function(){}) method.

Kind: event emitted by Modal

on:close

Event triggered when the Modal is hide or closed. Created with the Modal.on("close", function(){}) method.

Kind: event emitted by Modal

on:show

Event triggered when the Modal is showed. Created with the Modal.on("show", function(){}) method.

Kind: event emitted by Modal