This commit is contained in:
chrosey
2017-09-13 07:52:34 +02:00
parent a1f16c37f4
commit 2340b0226b
24621 changed files with 2912161 additions and 149 deletions
+49 -1
View File
@@ -1,5 +1,53 @@
// Site.js
$("#content").on('click-row.bs.table', function(e, row, $element) {
$(".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;
}
});
});
$('#confirmDeletionModal').on('show.bs.modal', function (event) {
event.stopPropagation();
var button = $(event.relatedTarget) // Button that triggered the modal
var data = button.data() // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('#identifier').text(data.identifier);
modal.find('#confirmDeletionButton').data('url',data.url);
});
$("#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;
}
});
});