@serenity-is/corelib / Dialog
Class: Dialog
Table of contents
Constructors
Properties
Accessors
Methods
- close
- createBSModal
- createUIDialog
- dispose
- getContentNode
- getDialogNode
- getEventsNode
- getFooterNode
- getHeaderNode
- onClose
- onOpen
- open
- title
- getInstance
Constructors
constructor
• new Dialog(opt?): Dialog
Parameters
| Name | Type |
|---|---|
opt? |
DialogOptions |
Returns
Defined in
Properties
defaults
▪ Static defaults: DialogOptions
Defined in
messageDefaults
▪ Static messageDefaults: MessageDialogOptions
Defined in
Accessors
result
• get result(): string
The result code of the button that is clicked. Also attached to the dialog element as data-dialog-result
Returns
string
Defined in
type
• get type(): DialogType
Returns
Defined in
Methods
close
▸ close(): this
Closes dialog setting the result to null
Returns
this
Defined in
▸ close(result): this
Closes dialog with the result set to value
Parameters
| Name | Type |
|---|---|
result |
string |
Returns
this
Defined in
createBSModal
▸ createBSModal(opt): void
Parameters
| Name | Type |
|---|---|
opt |
DialogOptions |
Returns
void
Defined in
createUIDialog
▸ createUIDialog(opt): void
Parameters
| Name | Type |
|---|---|
opt |
DialogOptions |
Returns
void
Defined in
dispose
▸ dispose(): void
Returns
void
Defined in
getContentNode
▸ getContentNode(): HTMLElement
Gets the body/content element of the dialog
Returns
HTMLElement
Defined in
getDialogNode
▸ getDialogNode(): HTMLElement
Gets the dialog element of the dialog
Returns
HTMLElement
Defined in
getEventsNode
▸ getEventsNode(): HTMLElement
Gets the node that receives events for the dialog. It's .ui-dialog-content, .modal, or .panel-body
Returns
HTMLElement
Defined in
getFooterNode
▸ getFooterNode(): HTMLElement
Gets the footer element of the dialog
Returns
HTMLElement
Defined in
getHeaderNode
▸ getHeaderNode(): HTMLElement
Gets the header element of the dialog
Returns
HTMLElement
Defined in
onClose
▸ onClose(handler, before?): void
Parameters
| Name | Type | Default value |
|---|---|---|
handler |
(result?: string, e?: Event) => void |
undefined |
before |
boolean |
false |
Returns
void
Defined in
onOpen
▸ onOpen(handler, before?): this
Parameters
| Name | Type | Default value |
|---|---|---|
handler |
(e?: Event) => void |
undefined |
before |
boolean |
false |
Returns
this
Defined in
open
▸ open(): Dialog
Closes dialog
Returns
Defined in
title
▸ title(): string
Gets the title text of the dialog
Returns
string
Defined in
▸ title(value): this
Sets the title text of the dialog.
Parameters
| Name | Type |
|---|---|
value |
string |
Returns
this
Defined in
getInstance
▸ getInstance(el): Dialog
Parameters
| Name | Type |
|---|---|
el |
HTMLElement | ArrayLike<HTMLElement> |