Constructor
new ConfirmationDialog()
Properties:
Name | Type | Description |
---|---|---|
message |
string | the message to use to ask for confirmation |
confirm-label |
string | the label to use for the "OK" or "Confirm" button |
- Source:
Example
Minimal Example
<brut-confirmation-dialog message="This cannot be undone" confirm-label="DOIT">
<dialog>
<h1></h1>
<button value="ok"></button>
<button value="cancel">Nevermind</button>
</dialog>
</brut-confirmation-dialog>
Methods
showModal(onClose)
Call this to show the dialog. When the dialog is closed, onClose
is called with the result.
Parameters:
Name | Type | Description |
---|---|---|
onClose |
function | a function called with either |
- Source:
Example
dialog.showModal( (confirmed) => {
if (confirmed) {
form.submit()
}
else {
// do nothing
}
})