Class: Dialog

nyc/Dialog~ Dialog


new Dialog(options)

Create an instance of Dialog

Parameters:
Name Type Description
options module:nyc/Dialog~Dialog.Options

Constructor options

Source:

Extends

Members


<static> Type :string

Dialog type

Type:
  • string
Properties:
Name Type Default Description
OK string ok

Dialog with OK button

YES_NO string yes-no

Dialog with Yes and No buttons

YES_NO_CANCEL string yes-no-cancel

Dialog with Yes, No and Cancel buttons

INPUT string input

Dialog to accept user input

Source:

Methods


append(elements)

A method to append elements to the container

Parameters:
Name Type Description
elements jQuery | Element | Array.<Element> | string

The element to append

Inherited From:
Overrides:
Source:
Returns:

The container

Type
jQuery

find(selector)

A method to return elements in the container

Parameters:
Name Type Description
selector string

jQuery selector

Inherited From:
Overrides:
Source:
Returns:

The element

Type
jQuery

getContainer()

A method to return a control container HTML element wrapped in a JQuery

Inherited From:
Overrides:
Source:
Returns:

The the control container HTML element wrapped in a JQuery

Type
jQuery

input(options)

Show the input dialog

Parameters:
Name Type Description
options module:nyc/Dialog~Dialog.ShowOptions

Dialog options

Source:
Returns:

The async result of the user action

Type
Promise.<(string|boolean|undefined)>

off(eventName, evtHdlr [, hdlrScope])

Remove a previously connected event handler

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

ok(options)

Show the ok dialog

Parameters:
Name Type Description
options module:nyc/Dialog~Dialog.ShowOptions

Dialog options

Source:
Returns:

The async result of the user action

Type
Promise.<boolean>

on(eventName, evtHdlr [, hdlrScope])

Connect a function to an event

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

one(eventName, evtHdlr [, hdlrScope])

Connect a function to an event for a single invocation

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

prepend(elements)

A method to prepend elements to the container

Parameters:
Name Type Description
elements jQuery | Element | Array.<Element> | string

The element to append

Inherited From:
Overrides:
Source:
Returns:

The container

Type
jQuery

trigger(eventName [, data])

Trigger a named event with event data

Parameters:
Name Type Argument Description
eventName string

The name of the event to trigger

data Object <optional>

The event data

Inherited From:
Overrides:
Source:

yesNo(options)

Show the yes-no dialog

Parameters:
Name Type Description
options module:nyc/Dialog~Dialog.ShowOptions

Dialog options

Source:
Returns:

The async result of the user action

Type
Promise.<boolean>

yesNoCancel(options)

Show the yes-no-cancel dialog

Parameters:
Name Type Description
options module:nyc/Dialog~Dialog.ShowOptions

Dialog options

Source:
Returns:

The async result of the user action

Type
Promise.<(boolean|undefined)>

Type Definitions


Options

Dialog options.

Type:
  • Object
Properties:
Name Type Argument Default Description
target jQuery | Element | string <optional>
body

The DOM element in which the dialog is displayed

css string <optional>

A CSS class for the dialog

Source:

ShowOptions

Dialog options.

Type:
  • Object
Properties:
Name Type Argument Description
message jQuery | Element | string

Message content

buttonText Array.<string> <optional>

Button text list

buttonHref Array.<string> <optional>

Button href list

placeholder string <optional>

Placeholder text for input dialog

Source: