Class: Dialog

Dialog

new Dialog()

A dialog window with custom content.
Source:

Members

(static) ButtonConfiguration :string

Button configurations for a dialog.
Type:
  • string
Properties:
Name Type Description
OK_CANCEL string An OK and a Cancel button. This is the default configuration.
OK string Only an OK button.
YES_NO string A Yes and a No buttons
Source:

Methods

dispose()

Disposes all the resources associated with the dialog, un-registers all the listeners and removes it from the DOM.
Source:

getElement() → {HTMLElement}

Returns the HTML element that represents the content of the dialog window, So that custom content can be added to it.
Source:
Returns:
The element of the dialog.
Type
HTMLElement

hide()

Hides the dialog window.
Source:

onSelect(callback)

Sets the callback to be called when a button is pressed. It is called only once.
Parameters:
Name Type Description
callback sync.api.Dialog~onSelectCallback the callback used when the user chooses an option on the dialog.
Source:

setButtonConfiguration(config)

Sets the button configuration of the dialog.
Parameters:
Name Type Description
config sync.api.Dialog.ButtonConfiguration The button configuration
Source:

setTitle(title)

Sets the title of the dialog window.
Parameters:
Name Type Description
title string The title of the dialog window.
Source:

show()

Shows the dialog window.
Source:

Type Definitions

onSelectCallback(key, The)

A callback that receives the key of the button that was pressed, and the select event itself.
Parameters:
Name Type Description
key string The key of the selected button.
The goog.event.Event select event, which you can preventDefault() in order to keep the dialog open.
Source: