/ui/elements/confirm

Exports the confirm dialog method as mapp.ui.elements.confirm()

Requires

Methods

(inner) confirm(params) → {Promise.<boolean>}

This is a confirm element to display information to the user and resolving to yes/no response.

It is a framework alternative way to using window.confirm() browser function.

const confirm = await mapp.ui.elements.confirm({
   text: "Please confim changes."
})
if(confirm) {
// proceed
} else {
// prevent
}
Parameters:
NameTypeDescription
paramsObject

Params for the configuration dialog.

Properties
NameTypeAttributesDefaultDescription
params.data_idstring<optional>
'confirm'

The data-id attribute value for the dialog.

params.titlestring<optional>

Text to display in the confirm header. Defaults to 'Confirm'.

params.textstring<optional>

Text to display in the confirm content.

Returns:

Returns promise which resolves to true or false whether the question was confirmed.

Type: 
Promise.<boolean>