import Swiper from 'swiper';

function togglePopup() {
    const block = $('.photo-tape');

    block.find('.photo-tape__item').off('hover');
    block.off('click');

    if (!!('ontouchstart' in window)) {
        block.on('click', '.photo-tape__link', function(e) {
            console.log('click');
            e.preventDefault();

            const popup = $(this).siblings('.model-info-popup');

            popup.parents('.photo-tape').find('.model-info-popup').fadeOut();

            if (popup.is(':visible')) {
                popup.fadeOut();
            } else {
                popup.fadeIn();
            }
        });
    } else {
        block.find('.photo-tape__item').hover(
            function() {
                $(this).find('.model-info-popup').fadeIn();
            },
            function() {
                $(this).find('.model-info-popup').fadeOut();
            }
        );
    }
}

export default function photoTape() {
    const block = $('.photo-tape .swiper-container');

    if (!block.length) {
        return;
    }

    new Swiper(block, {
        slidesPerView: 'auto',
        freeMode: true
    });

    togglePopup();
}

@@ -156,24 +156,47 @@
 ('click');%0A%0A
+    let timer = null;%0A%0A
     if (!!('
@@ -740,32 +740,45 @@
 %0A               
+ const item =
  $(this).find('.
@@ -799,58 +799,189 @@
 up')
-.fadeIn();%0A            %7D,%0A            function() %7B
+;%0A                timer = setTimeout(() =%3E %7B%0A                    item.fadeIn();%0A                %7D, 200);%0A            %7D,%0A            function() %7B%0A                clearTimeout(timer);
 %0A   

fix photo-tape