Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add .delete-confirm class to your delete button or href
- <script>
- // Swal
- $('.delete-confirm').on('click', function(e) {
- var href = this;
- e.preventDefault();
- swal({
- title: "Êtes-vous sûr?",
- text: "Après suppression l'article ne sera plus accessible",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: '#e74c3c',
- cancelButtonText: "Non, annuler!",
- confirmButtonText: "Oui, supprimer!",
- closeOnConfirm: false,
- closeOnCancel: false
- },
- function(isConfirm) {
- if (isConfirm) {
- window.location.href = href;
- } else {
- swal("Annulation", "Vous avez annuler la suppression :)", "success");
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment