(function($) {
$.evo.myBasket = function() {
var basket = $.evo.basket();
basket.pushedToBasket = function(response) {
var $snackbar = $('#snackbar');
if ($snackbar.length == 0) {
$snackbar = $('<div id="snackbar"></div>');
$('#main-wrapper').append($snackbar);
}
$snackbar
.html(response.cNotification)
.addClass('show');
setTimeou t(function(){
$snackbar.removeClass('show');
}, 3000);
};
return basket;
};
// Dies gilt für die Version 4.04
// ##############################
$('*[data-toggle="basket-add"]').off('submit');
$('*[data-toggle="basket-add"]').on('submit', function(event) {
event.preventDefault();
$.evo.myBasket().addToBasket($(this));
});
// Für Version ab 4.05
// ###################
$('#main-wrapper').off('submit', '[data-toggle="basket-add"]');
$('#main-wrapper').on('submit', '[data-toggle="basket-add"]', function(event) {
event.preventDefault();
$.evo.myBasket().addToBasket($(this));
})
})(jQuery);