Skip to content

Commit

Permalink
Update _DeleteScriptsPartial.cshtml
Browse files Browse the repository at this point in the history
Updated delete warning to use SweetAlert

#8
  • Loading branch information
mmahomar committed Jun 25, 2022
1 parent 73420ac commit 6bde0e5
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions MEInsight.Web/Views/Shared/_DeleteScriptsPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@
.on('click', function(e) {
// prevents default submit
e.preventDefault();
// activates ladda-button 'loading..' style and disables submit button after one click
//var l = Ladda.create(this);
// activates button 'loading..' style and disables submit button after one click
//TODO
//$('.spinner').removeClass('d-none');
//$('#submitbutton').addClass('disabled');
//// disable cancel button after submit
//$('#cancelbutton').addClass('disabled');
//TODO --replace with
// <!-- button group start -->
//<div class="form-group text-right mt-5">
// <a id="cancelbutton" class="btn btn-secondary mr-2" asp-action="Index">
// <i class="fas fa-times"></i> Cancel
// </a>
// <button id="submitbutton" type="submit" value="Create" class="btn btn-primary">
// <span class="d-none spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
// <i class="fas fa-check"></i> Create
// </button>
//</div>
//<!-- button group end -->
Swal.fire({
toast: true,
title: '@Localizer["Are you sure?"]',
text: "Deleting this record will delete ALL related records. This cannot be undone.",
icon: 'warning',
Expand All @@ -25,11 +41,11 @@
}).then((result) => {
if (result.isConfirmed) {
var form = $('#main-form');
form.submit();
form.submit();
}
});
});
});
</script>

0 comments on commit 6bde0e5

Please sign in to comment.