Guest User

Untitled

a guest
Jul 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // Add .delete-confirm class to your delete button or href
  2.  
  3. <script>
  4. // Swal
  5. $('.delete-confirm').on('click', function(e) {
  6. var href = this;
  7. e.preventDefault();
  8. swal({
  9. title: "Êtes-vous sûr?",
  10. text: "Après suppression l'article ne sera plus accessible",
  11. type: "warning",
  12. showCancelButton: true,
  13. confirmButtonColor: '#e74c3c',
  14. cancelButtonText: "Non, annuler!",
  15. confirmButtonText: "Oui, supprimer!",
  16. closeOnConfirm: false,
  17. closeOnCancel: false
  18. },
  19. function(isConfirm) {
  20. if (isConfirm) {
  21. window.location.href = href;
  22. } else {
  23. swal("Annulation", "Vous avez annuler la suppression :)", "success");
  24. }
  25. });
  26. });
  27. </script>
Add Comment
Please, Sign In to add comment