Hello, I need to modify this function to use callback as a function return and not as a new function call via callback.
I need this in this way because I'm creating a generic method for deletion acknowledgments on the existing system. If I can not, it will give me a lot of work to do with the changes.
I'm using the JS BootBox library and the method is:
function Confirm(messageOfConfirmation){
bootbox.confirm({
message: messageOfConfirmation,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
functionOfCallback(result);
}
});
}
And to reinforce and avoid understandings of duplicity in the question, here is an example of how I intend to use it.
function PodeExcluir(){
if(Confirm("Tem certeza que deseja excluir?"){
//Chamada de exclusão aqui
}
}
I mean, today the system already uses the standard JS confirm but I need to change it.