The settings for the confirmation dialog.
// Create a new confirmation dialog with a title, message and two buttons.
async function exampleUsage() {
return new Promise((resolve, reject) => {
ix.api.confirm.show({
'title': ix.text.i18n.get("TOOLTIP_CLOSE"),
'message': ix.text.i18n.get("TOOLTIP_CLOSE_CONFIRM_DIALOG"),
'buttons': {
'Yes': {
'css': 'margin:0 5px 0 5px;',
'action': () => resolve()
},
'No': {
'css': 'margin:0 5px 0 5px;',
'action': () => reject()
}
},
'escAction': () => reject()
});
}).then(() => {
console.log('User clicked Yes');
// Add your logic here for when the user clicks Yes
}).catch(() => {
console.log('User clicked No or pressed Esc');
// Add your logic here for when the user clicks No or presses Esc
});
}
// Call the function to show the confirmation dialog
exampleUsage();
Displays a confirmation dialog to the user with configurable settings.