2021-05-26 16:26:01 +02:00
|
|
|
import 'bootstrap';
|
|
|
|
|
2021-05-24 14:08:30 +02:00
|
|
|
$(function() {
|
|
|
|
initDeleteButtons();
|
|
|
|
})
|
|
|
|
|
|
|
|
function initDeleteButtons() {
|
|
|
|
$('.delete-btn').on('click', function() {
|
|
|
|
let me = $(this)
|
|
|
|
let href = me.data('href');
|
|
|
|
let confirmation = me.data('confirmation');
|
|
|
|
|
|
|
|
if(confirm(confirmation)) {
|
|
|
|
$.ajax({
|
|
|
|
url: href,
|
|
|
|
method: 'DELETE',
|
|
|
|
success: function(data) {
|
|
|
|
window.location.href = data.return_path;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|