Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $(".delWishes").click(function () {
- var product= $(this).attr('data-productid');
- $.ajax({
- url: "/ajax/wishNew.php",
- type: 'post',
- data: {product_id: product},
- context: this,
- success: function (data) {
- $("#fav_prod_"+product).remove();
- $('#countWish').text(data);
- },
- });
- });
- if($('#countWish').html() == 0){
- $('.catalog-item-fav.favorite_check').removeClass('checked');
- };
- $(document).on("click", ".cookie_alert_close", function () {
- BX.setCookie('cookie_alert', 'Y', {expires: 999999999, path: '/'});
- $('.cookie_alert').remove();
- });
- $(document).on("click", ".getCouponRegister", function(){
- $('.lc-btn').click();
- setTimeout(function(){
- $('[data-form="reg"]').click();
- },20);
- });
- });
- (function () {
- var totalWidth = 0;
- var rowNum = 1;
- var tagsBlockWidth = $('.tags-block').outerWidth() - 10;
- var allTagsWidth = $('.tags-collapse').outerWidth() + 20;
- $('.tags-block a.tag').each(function () {
- var width = $(this).outerWidth() + 19;
- if (rowNum < 3)
- totalWidth += width;
- if (totalWidth > tagsBlockWidth && rowNum === 1) {
- totalWidth = width + allTagsWidth;
- rowNum = 2;
- }
- if (totalWidth > tagsBlockWidth && rowNum === 2) {
- rowNum = 3;
- }
- if (rowNum === 3) {
- $(this).addClass('all-tag').addClass('hidden-tag');
- }
- });
- if (rowNum < 3)
- $('.tags-collapse').remove();
- $('.tags-block').addClass('active');
- $(".tags-collapse").click(function () {
- if ($(".all-tag.hidden-tag").length > 0) {
- $(".tags-collapse").text("Основные метки");
- $(".all-tag").removeClass("hidden-tag");
- } else {
- $(".tags-collapse").text("Все метки");
- $(".all-tag").addClass("hidden-tag");
- }
- });
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement