Hello.
On the site everywhere in js-scripts on some functions worth checking
function name(){ if (!confirm("Удалить?")) { return; } ......выполнение.... } I started using sweetalert for bootstrap, but I realized that it would take a very long time to remove the confirm confirm in all files. I decided to try to cheat - just override the function
function confirm(text){ swal({ title: text, type: "warning", showCancelButton: true, cancelButtonClass: 'btn', cancelButtonText: 'Нет', confirmButtonClass: "btn-danger", confirmButtonText: "Да", closeOnConfirm: false }, function (isConfirm) { if (isConfirm) { //тут подтверждение } else { //тут отказ } }); } Tell me how to make this function return true or false, so that the test works correctly everywhere?
confirmit will not work. - Igor