-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
Hello,
is it possible add into the options parameter of confirm function a dictionary with a custom label for each button?
Maybe something like {"cancel":"Cancel Button Label","close":"Cancel Button Label","ok":"Ok Button Label"} , pass into the getTemplate function this labels dictionary and use call labels[name] || name.
function getTemplate(title, msg, value, buttons, labels) {
const encodedMsg = msg.replace(/\n/g, '<br>');
return `<div class="page">
<div data-name="js-close" class="close-button"></div>
<header>${ title }</header>
<div class="content-area">${ encodedMsg }${ value }</div>
<div class="action-area">
<div class="button-strip"> ${
buttons.map((name, i) =>
`<button tabindex=${ i } data-name="js-${ name.toLowerCase() }">${ labels[name] || name }</button>`
).join('')
}
</div>
</div>
</div>`;
}
Thanks
Paolo