51 lines
1.0 KiB
JavaScript
Vendored
51 lines
1.0 KiB
JavaScript
Vendored
// Site.js
|
|
|
|
$(".clickable-row").on('click', function(e) {
|
|
$element = $(this);
|
|
window.location = $element.data('href');
|
|
});
|
|
|
|
$(document).ready(function(){
|
|
$('.load-async').each(function(){
|
|
$me = $(this);
|
|
$.get($me.data('href'),function(data){
|
|
$me.html(data);
|
|
});
|
|
});
|
|
});
|
|
|
|
$(".confirm-logout").click(function() {
|
|
var data = $(this).data();
|
|
$.post({
|
|
url: data.url,
|
|
headers: {
|
|
'X-CSRF-TOKEN': data.token
|
|
},
|
|
success: function(data){
|
|
window.location.href = data;
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#confirmDeletionButton").click(function() {
|
|
var data = $(this).data();
|
|
$.ajax({
|
|
url: data.url,
|
|
headers: {
|
|
'X-CSRF-TOKEN': data.token
|
|
},
|
|
type: "DELETE",
|
|
success: function(data){
|
|
window.location.href = data;
|
|
}
|
|
});
|
|
});
|
|
|
|
$('.modal').modal({
|
|
ready: function(modal,trigger){
|
|
var data = trigger.data();
|
|
|
|
modal.find('#identifier').text(data.identifier);
|
|
modal.find('#confirmDeletionButton').data('url', data.url);
|
|
}
|
|
}); |