common/dialog

class Dialog(vueOpts)
Extends:

Vue

Creates an simple extensible (modal) dialog.

Arguments:
  • vueOpts (Object) – The options given to the vue instance.
  • vueOpts.appendTo (HTMLElement) – The element to append the dialog to. (optional)
  • vueOpts.data (Object) – The configuration of the dialog. The keys in this object are the same as the properties on the instance.
rootClass
Type:

String

Default:

“”

An optional, additional CSS class on the very root node of the dialog.

containerClass
Type:String
Default:“”

An optional, additional CSS class on the container node of the dialog.

iconClass
Type:String (CSS icon class)
Default:“”

If given, this icon will be displayed in front of the title.

title
Type:String
Default:“”

The title of the dialog.

body
Type:String (HTML)
Default:“”

The body of the dialog. Is interpreted as HTML.

closable
Type:

Boolean

Default:

true

Whether the dialog can be closed by clicking a cross in its opper right corner.

backdrop
Type:

Boolean

Default:

true

Whether the background should be grayed out or not.

isShown
type:Boolean
default:false

Wherther the dialog is currently shown. If set from the beginning, the inital animation is skipped.

onOpen
Type:Function
Default:null

If providied, this function will be called when opening the dialog.

onClose
Type:Function
Default:null

If providied, this function will be called when closing the dialog.

buttons
Type:Object
Default:{}

An object containing further object describing the button to be present in the footer.

button.*.label
Type:String

The label of the button.

button.*.iconClass
Type:String (CSS icon class)

The icon of the button.

button.*.class
Type:String (CSS class)

The CSS class of the button.

button.*.pos
Type:Number|String

The buttons are sorted by this value. (ascending).

button.*.callback
Type:Function

The function to be called when this button is clicked. (this is the dialog instance). If it returns true, the dialog will stay open. If not provided it will close too.

focusButton
Type:String

The button with this key will be initally focused.

class PromptDialog(vueOpts)
Extends:Dialog
callback
Type:Function

The callback that will be called with the result of the prompt.

value
Type:String
Default:“”

The current value of the prompt input. If provided from the beginning, this is the default value.

password
Type:

Boolean

Default:

False

Wheter the prompted value should be masked (for passwords prompting).

placeholder
Type:String
Default:“”

The placeholder value of prompt input - only visible with no current input and no focus.

Dialog.dialog(opts[, appendTo])

Opens a dialog.

Arguments:
  • opts (Object) – The same object as vueOpts.data of Dialog().
  • appendTo (HTMLNode) – The same parameter as vueOpts.appendTo of Dialog(). If not providied, it will attempted to fill it with this.$messageContainer (see BaseView()).
Dialog.alert(message[, opts[, appendTo]])

Shows an alert message.

Arguments:
  • message (String) – The message to be displayed
  • opts (Object) – The same object as vueOpts.data of Dialog(). Will be merged over the opts generated by the other parameters.
  • opts.okLabel (String) – An easy way to overwrite the default label “Ok” (other route is opts.buttons.ok.label).
  • appendTo (HTMLNode) – The same parameter as vueOpts.appendTo of Dialog(). If not providied, it will attempted to fill it with this.$messageContainer (see BaseView()).
Dialog.confirm(message, callback[, opts[, appendTo]])

Shows an alert message.

Arguments:
  • message (String) – The message to be displayed
  • opts (Object) – The same object as vueOpts.data of Dialog(). Will be merged over the opts generated by the other parameters.
  • opts.yesLabel (String) – An easy way to overwrite the default label “Yes” (other route is opts.buttons.yes.label).
  • opts.noLabel (String) – An easy way to overwrite the default label “No” (other route is opts.buttons.no.label).
  • appendTo (HTMLNode) – The same parameter as vueOpts.appendTo of Dialog(). If not providied, it will attempted to fill it with this.$messageContainer (see BaseView()).
Callback args:
  1. yesChosen (Boolean) – The yes(-kind) optiong was chosedn.
Dialog.prompt(message, callback[, opts[, appendTo]])

Shows an alert message.

Arguments:
  • message (String) – The message to be displayed
  • opts (Object) – The same object as vueOpts.data of Dialog(). Will be merged over the opts generated by the other parameters.
  • opts.cancelLabel (String) – An easy way to overwrite the default label “Cancel” (other route is opts.buttons.cancel.label).
  • opts.okLabel (String) – An easy way to overwrite the default label “Ok” (other route is opts.buttons.ok.label).
  • appendTo (HTMLNode) – The same parameter as vueOpts.appendTo of Dialog(). If not providied, it will attempted to fill it with this.$messageContainer (see BaseView()).
Callback args:
  1. result (String|null) – The result of the prompt.