#10 Promotion Modul, Kommentar 2
This commit is contained in:
parent
f0da981737
commit
c9e1545693
128 changed files with 8194 additions and 637 deletions
58
public/js/shop.js
Normal file
58
public/js/shop.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
$(function() {
|
||||
|
||||
$('select').selectpicker();
|
||||
|
||||
|
||||
$('#modals-load-content').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
if (!button.data('id')) {
|
||||
return;
|
||||
}
|
||||
var data = {};
|
||||
$.each(button.data(), function(index, value){
|
||||
if(index !== 'bs.tooltip'){
|
||||
data[index] = value;
|
||||
}
|
||||
});
|
||||
console.log(data);
|
||||
|
||||
loadModalInner(this, data);
|
||||
|
||||
});
|
||||
|
||||
function loadModalInner(self, data){
|
||||
var url = data.route,
|
||||
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
contentType: contentType,
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
if(data.response.modal){
|
||||
$(data.response.target).find('.modal-dialog').addClass(data.response.modal);
|
||||
}
|
||||
$(data.response.target).find('.modal-dialog').html(data.html);
|
||||
//$(data.response.target).find('.selectpicker').selectpicker('refresh');
|
||||
},
|
||||
error: function(xhr, status, errorThrown) {
|
||||
console.log(xhr);
|
||||
console.log(xhr.responseText);
|
||||
console.log(errorThrown);
|
||||
console.log("Sorry, there was a problem!");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
function _scrollTo(to, offset) {
|
||||
$('html,body').animate({scrollTop: $(to).offset().top - offset}, 800);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue