#51 Festschreiben der Points, Gutschriftenmodul
This commit is contained in:
parent
dfd049aaa9
commit
3f2fbd6d5b
63 changed files with 4610 additions and 971 deletions
|
|
@ -96,7 +96,43 @@ jQuery(document).ready(function() {
|
|||
function _scrollTo(to, offset) {
|
||||
$('html,body').animate({scrollTop: $(to).offset().top - offset}, 800);
|
||||
}
|
||||
|
||||
function ajax_object_action(event, object, callback) {
|
||||
// event.preventDefault();
|
||||
var data = {};
|
||||
$.each(object.data(), function(index, value){
|
||||
if(typeof value !== 'object'){
|
||||
data[index] = value;
|
||||
}
|
||||
});
|
||||
var url = data['url'];
|
||||
// console.log(data);
|
||||
// console.log(url);
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(data) {
|
||||
//console.log(data);
|
||||
//data will send data to callback function
|
||||
callback(data);
|
||||
},
|
||||
error: function(xhr, status, errorThrown) {
|
||||
console.log(xhr);
|
||||
console.log(xhr.responseText);
|
||||
console.log(status);
|
||||
console.log(errorThrown);
|
||||
console.log("Sorry, there was a problem!");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$(function () {
|
||||
|
||||
$('#modals-load-content').on('show.bs.modal', function (event) {
|
||||
|
|
@ -164,40 +200,4 @@ $(function () {
|
|||
return false;
|
||||
}
|
||||
|
||||
function ajax_object_action(event, object, callback) {
|
||||
event.preventDefault();
|
||||
var data = {};
|
||||
$.each(object.data(), function(index, value){
|
||||
if(typeof value !== 'object'){
|
||||
data[index] = value;
|
||||
}
|
||||
});
|
||||
var url = data['url'];
|
||||
console.log(data);
|
||||
console.log(url);
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(data) {
|
||||
//data will send data to callback function
|
||||
callback(data);
|
||||
},
|
||||
error: function(xhr, status, errorThrown) {
|
||||
console.log(xhr);
|
||||
console.log(xhr.responseText);
|
||||
console.log(status);
|
||||
console.log(errorThrown);
|
||||
console.log("Sorry, there was a problem!");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue