Home Reference Source
import AlertDialog from '@osjs/dialogs/src/dialogs/alert.js'
public class | source

AlertDialog

Extends:

Dialog → AlertDialog

Default OS.js Alert Dialog

Constructor Summary

Public Constructor
public

constructor(core: Core, args: Object, callback: Function)

Constructor

Inherited Summary

From class Dialog
public

Gets the button (virtual) DOM elements

public

createView(children: Object[], state: Object): Object

Creates the default view

public

Destroys the dialog

public

emitCallback(name: String, ev: Event, close: Boolean)

Emits the callback

public

Gets the first negative button

public

Gets the first positive button

public

getValue(): *

Gets the dialog result value

public
public

render(cb: Function): *

Renders the dialog

Public Constructors

public constructor(core: Core, args: Object, callback: Function) source

Constructor

Override:

Dialog#constructor

Params:

NameTypeAttributeDescription
core Core

OS.js Core reference

args Object

Arguments given from service creation

args.title String
  • optional
  • default: 'Alert'

Dialog title

args.message String
  • optional
  • default: ''

Dialog message

args.type String
  • optional
  • default: 'info'

Alert type (info/warning/error)

args.sound String
  • optional
  • default: 'bell'

Sound

args.error Error | *
  • optional

When 'alert' type is set this error stack or message will appear in a textbox

callback Function

The callback function