$('#mark-completed-as-implemented').on('click', function () {
modbox.confirm({
body: 'Are you sure you want to mark all the completed requests as implemented?',
title: null,
center: true,
okButton: {
label: 'Yes',
style: 'success',
close: false,
callback: (event, modal) => {
console.log(this); // This does not point to the button, but to #mark-completed-as-implemented
$(this).prop('disabled', true).append('<i class="fa-duotone fa-spinner-third fa-spin ms-2"></i>');
sendAjax('mark_completed_as_implemented', { app_id: app_id }).then(response => {
if (!response.success) {
bs5_toast(response.data.message, 'error');
} else {
bs5_toast(response.data.message, 'success');
}
$(this).prop('disabled', false).find('.fa-spinner-third').remove();
modal.hide();
});
},
},
});
});