// start btn-delete $(document).on('click', '.delete-btn', function(e){ e.preventDefault() let that = $(this); Swal.fire({ title: "{{ __('confirm_delete') }} ", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', cancelButtonText: "{{ __('no') }} ", confirmButtonText: "{{ __('yes') }} ", }).then((result) => { if (result.value) { if(that.data('callback')){ executeFunctionByName(that.data('callback'), window) } else if(that.data('form')){ $(that.data('form')).submit() } else{ that.closest('form').submit() } } }) }); //end btn-delete