Skip to content

Commit 022143d

Browse files
committed
use sweetalert modals on delete server
1 parent abed575 commit 022143d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

resources/views/admin/servers/view.blade.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,20 @@
321321
$('select[name="remove_additional[]"]').find('option[value="' + $(this).val() + '"]').prop('disabled', true).prop('selected', false);
322322
});
323323
$('form[data-attr="deleteServer"]').submit(function (event) {
324-
if (confirm('Are you sure that you want to delete this server? There is no going back, all data will immediately be removed.')) {
325-
event.submit();
326-
}
324+
event.preventDefault();
325+
swal({
326+
title: '',
327+
type: 'warning',
328+
text: 'Are you sure that you want to delete this server? There is no going back, all data will immediately be removed.',
329+
showCancelButton: true,
330+
confirmButtonText: 'Delete',
331+
confirmButtonColor: '#d9534f',
332+
closeOnConfirm: false
333+
}, function (confirmed) {
334+
if (confirmed) {
335+
event.submit();
336+
}
337+
});
327338
});
328339
});
329340
</script>

0 commit comments

Comments
 (0)