PageSourceSearch

https://sormovich.com/t/v2222/images/js/quick_view.js

js sormovich.com collected 2026-09-30 17:13:16 UTC 33,551 bytes, 941 lines download raw bytes

1$(function(){
2
3    var quick_view_class = "product-quick-view";
4    var $quick_view_trigger;
5    var quick_trigger_class = '.quick-view-trigger';
6    var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
7
8    $(document).on("click", ".quick-view-trigger", function (e) {
9        e.preventDefault();
10        
11        if (!$quick_view_trigger) {
12            $quick_view_trigger = $(".quick-view-trigger");
13        };
14        
15        var $this = $(this);
16        var url = $this.attr("data-url") || $this.attr("href");
17
18        item = $(this).parents('.shop2-product-item').length>0 ? $(this).parents('.shop2-product-item') : $(this).parents('.kind-item');
19        ind = item.index();
20        
21        loadProduct(url, function (){
22            checkQuickViews(ind, item);
23            
24            setTimeout(function(){
25		        var defPriceBlock = ($('.form-additional-price').attr('prprice') / 10) * parseFloat($('.form-additional .shop2-product-amount input').val() * 10),
26					defPriceBlockMth = Math.ceil(defPriceBlock);
27					$('.form-additional-price .textbl span').text(defPriceBlockMth);
28				
29				$(document).on('click', '.shop2-product-amount .amount-plus, .shop2-product-amount .amount-minus', function(){
30					setTimeout(function(){
31						var defPriceBlock2 = ($('.form-additional-price').attr('prprice') / 10) * parseFloat($('.form-additional .shop2-product-amount input').val() * 10),
32							defPriceBlock2Mth = Math.ceil(defPriceBlock2);
33							$('.form-additional-price .textbl span').text(defPriceBlock2Mth);
34					}, 200);
35				});
36				
37				$('.form-additional .shop2-product-amount input').on('change', function(){
38					setTimeout(function(){
39						var defPriceBlock2 = ($('.form-additional-price').attr('prprice') / 10) * parseFloat($('.form-additional .shop2-product-amount input').val() * 10),
40							defPriceBlock2Mth = Math.ceil(defPriceBlock2);
41							$('.form-additional-price .textbl span').text(defPriceBlock2Mth);
42					}, 200);
43				});
44	        }, 200);
45            
46        });
47        
48    });
49
50
51    if (shop2 && shop2.product && shop2.product._reload) {
52        var reload = shop2.product._reload;
53
54        shop2.product._reload = function(node) {
55            var args = Array.prototype.slice.call(arguments, 0);
56            var popoverDiv = $(node).closest("." + quick_view_class);
57            
58            if (popoverDiv.length) {
59                reloadProduct(node);
60            } else {
61                reload.apply(this, args);
62            }
63        }
64    };
65
66    function loadProduct (url, callback) {
67        if (!myo) return false;
68        
69        if ($('.product-quick-view').length>0) {
70        	myo.close();
71        };
72        
73        myo.open({
74            ajax: url + '?&products_only=1',
75            wrapClass: quick_view_class,
76            onLoad: function () {
77                
78	            $('#shop2-tooltip').hide();
79                
80                // Слайдер и лупа 
81                if ($(".quick-card-slider__thumbs-slider").length>0) {
82                	$('.quick-card-slider__items-slider').slick({
83						slidesToShow: 1,
84						slidesToScroll: 1,
85						fade: true,
86						arrows: false,
87						asNavFor: '.quick-card-slider__thumbs-slider'
88					  });
89					  $('.quick-card-slider__thumbs-slider').slick({
90						slidesToShow: 4,
91						slidesToScroll: 1,
92						asNavFor: '.quick-card-slider__items-slider',
93						dots: false,
94						focusOnSelect: true,
95						infinite: false,
96						responsive: [
97							{
98								breakpoint: 1024,
99								settings: {
100								  slidesToShow: 3
101								}
102						    },
103							{
104								breakpoint: 640,
105								settings: {
106								  slidesToShow: 2
107								}
108							  },
109							]
110					  });
111                };
112                    
113                /*if (!isMobile && jQuery().zoom) {
114                    $('.gr-image-zoom').zoom({
115                        magnify: 1,
116                        duration: 10,
117                        onZoomIn: function(){
118                            $(this).parent().addClass('hide_small_pic');
119                        },
120                        onZoomOut: function(){
121                            $(this).parent().removeClass('hide_small_pic');
122                        },
123                        callback: function(){
124                            var $zoomImg = $(this);
125                            var zoomImgHeight = Math.floor($zoomImg.height());
126                            var zoomImgWidth = Math.floor($zoomImg.width());
127                            var floatHeight = Math.floor(20 * zoomImgHeight / 100);
128                            var floatWidth = Math.floor(20 * zoomImgWidth / 100);
129                            var prevWidth = Math.floor($(this).prev().outerWidth());
130                            var prevHeight = Math.floor($(this).prev().outerHeight());
131                            
132                            var zoomFloatHeight = zoomImgHeight + floatHeight;
133                            var zoomFloatWidth = zoomImgWidth + floatWidth;
134                            var finalHeight = prevHeight+floatHeight;
135                            var finalWidth = prevWidth+floatWidth;
136                            
137                            if (zoomFloatHeight<=prevHeight-floatHeight || zoomFloatWidth<=prevWidth-floatWidth) {
138                                $(this).parent().addClass('hide_big_pic');
139                            };
140                            
141                            if (zoomImgHeight<=prevHeight || zoomImgWidth <=prevWidth) {
142                                $zoomImg.css({
143                                    'width': finalWidth,
144                                    'height': finalHeight
145                                });
146                            }
147                        }
148                    });
149                };*/
150                
151                $('.quick-card-slider__items-slider img').on('load', function() {
152                    setTimeout(function(){
153                        $('.card_slider_loader').hide();
154                    }, 10);
155                });
156                
157					var getSizes = function(obj) {
158							return {
159								width: obj.width(),
160								height: obj.height()
161							};
162						},
163						getRatio = function(width, height, targetWidth, targetHeight) {
164							var widthRatio = width / targetWidth,
165								heightRatio = height / targetHeight,
166								res;
167							if (widthRatio > heightRatio) {
168								res = widthRatio;
169							} else {
170								res = heightRatio;
171							}
172							if (res < 1) {
173								res = 1;
174							}
175							return res;
176						},
177						big_a = $('.product-image > a'),
178						big_img = big_a.children(),
179						big_parent = big_a.parent(),
180						big_sizes = getSizes(big_parent),
181						preloader = "<div class='shop2-preloader'></div>";
182					$('body').append(preloader);
183					preloader = $('.shop2-preloader');
184					$(document).on('click', '.thumbnails-in a', function(e) {
185						e.preventDefault()
186						console.log(123)
187						var small_a = $(this),
188							small_img = small_a.children(),
189							small_sizes = getSizes(small_a.parent()),
190							img = new Image(),
191							offset = big_parent.offset();
192						img.onload = function() {
193							var href = big_a.attr('href'),
194								ratio = getRatio(img.width, img.height, big_sizes.width, big_sizes.height);
195							big_a.attr('href', img.src);
196							big_img.attr('src', img.src).css({
197								width: img.width / ratio,
198								height: img.height / ratio
199							});
200							preloader.hide();
201		
202							// img = new Image();
203							// img.onload = function() {
204							// 	var ratio = getRatio(img.width, img.height, small_sizes.width, small_sizes.height)
205							// 	small_a.attr('href', img.src);
206							// 	small_img.attr('src', img.src).css({
207							// 		width: img.width / ratio,
208							// 		height: img.height / ratio
209							// 	});
210							// }
211							// img.src = href;
212							
213							//$('.shop2-product .thumbnails-in li img).on(clickStart, function (){
214							var $thumbHeight = $('.product-image').height();
215							$('.product-thumbnails, .product-thumbnails-wrap .scrollbar').css({
216								'height': $thumbHeight
217							});			
218							//})					
219						}
220						preloader.show().css({
221							top: offset.top,
222							left: offset.left,
223							width: big_parent.width(),
224							height: big_parent.height()
225						});
226						img.src = small_a.attr('href');
227						return false;
228					});
229
230                let $slySliderFlag = 1,
231                	$testSl;
232            	$('.product-thumbnails-wrap').each(function() {
233						$testSl = $(this).find('.product-thumbnails');
234				});
235				
236				if (shop2.my.gr_fix_lg) {
237	          /*id1552*/
238	          	  $('.product-side-l .product-image').lightGallery({
239	                selector: 'a',
240	                thumbnail: false,
241	                download: false
242	              });
243	          } else {
244	          	/*$('.product-side-l .product-image-wrap').lightGallery({
245		            selector: '.light_gallery_opener',
246		            thumbnail: false,
247		            download: false
248		          });*/
249	          }
250				
251				$('.form-top__one-click').on('click', function(e){
252		
253					if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
254						$('html, body').removeClass('overflowHidden');
255					} else {
256						$(document.documentElement).addClass('overflowHidden');
257					}
258		
259					$('.product-includeForm2').addClass('active');
260					var productName = $(this).find('.productName').val()+(' Количество:' + $(this).closest('.product-wrapper__side-right').find('.shop2-product-amount input[type="text"]').val()),
261						productLink = (shop2.mode!=="product") ? (document.location.origin)+$(this).closest('.shop2-product').find('.product-name > a').attr('href') : (document.location.href);
262		
263					setTimeout(function() {
264						$('.product-includeForm2 input.productName').val(productName);
265						$('.product-includeForm2 input.productLink').val(productLink);
266					}, 800);
267					e.preventDefault();
268				});
269				$(document).on("keydown", function (e) {
270					if (e.keyCode===27) {
271						$('.product-includeForm').removeClass('active');
272						$('html, body').removeClass('overflowHidden');
273		
274					};
275				});
276                if ($('.product-thumbnails-wrap').length > 0) {
277					if ($(window).width() <= 920 && $slySliderFlag == 1) {
278								$testSl.slick(false);
279							var $slidee = $testSl.children('.product-thumbnails').eq(0),
280								$wrap  = $testSl.parent();
281								$testSl.slick({
282									slidesToShow: 1,
283							        slidesToScroll: 1,
284							        arrows: false,
285							        fade: true,
286							        asNavFor: '.product-slider-bot',
287									responsive: [
288										{
289											breakpoint: 768,
290											settings: {
291												variableWidth: false,
292												asNavFor: null,
293												slidesToShow: 1,
294												slidesToScroll: 1,
295												fade: false,
296												arrows: true
297											}
298										}
299									]
300								});
301						//$('.product-image').after($('.product-thumbnails-wrap'));
302						$('.product-thumbnails').after($('.product-thumbnails-wrap1 .scrollbar'));
303						$('.product-thumbnails-wrap').show();
304						var $thumbHeight = 'auto';
305						$('.product-thumbnails').css({
306							'height': $thumbHeight
307						});
308						$('.product-thumbnails-wrap .scrollbar').css({
309							'height': 2
310						})
311						$slySliderFlag = 2;
312					} else if ($(window).width() > 921 && $slySliderFlag == 2 || $slySliderFlag == 1) {
313								$testSl.slick(false);
314							var $slidee = $testSl.children('.product-thumbnails').eq(0),
315								$wrap   = $testSl.parent();
316								$testSl.slick({
317									slidesToShow: 1,
318							        slidesToScroll: 1,
319							        arrows: false,
320							        fade: true,
321							        asNavFor: '.product-slider-bot',
322									responsive: [
323										{
324											breakpoint: 768,
325											settings: {
326												variableWidth: false,
327												asNavFor: null,
328												slidesToShow: 1,
329												slidesToScroll: 1,
330												fade: false,
331												arrows: true
332											}
333										}
334									]
335								});
336						//$('.product-image').before($('.product-thumbnails-wrap'));
337						$('.product-thumbnails').before($('.product-thumbnails-wrap1 .scrollbar'));
338						var $thumbHeight = $('.product-image').height();
339							$('.product-thumbnails, .product-thumbnails-wrap .scrollbar').css({
340								'height': $thumbHeight
341							});
342						$slySliderFlag = 1
343					} if ($(window).width() <= 920) {
344						var ThumbItemWidth = 18.4,
345							ThumbItemMargin = 2.2;
346					} else if ($(window).width() > 920) {
347						var ThumbItemWidth = 60,
348							ThumbItemMargin = 0;
349					}
350					if ($(window).width() <= 768) {
351						var ThumbItemWidth = 23.7,
352							ThumbItemMargin = 2.2;
353					}
354					var ThumbnailWrap = $('.product-thumbnails-wrap').width(),
355						ThumbnailWidth = Math.floor((ThumbnailWrap/100)*ThumbItemWidth),
356						ThumbnailMargin = Math.floor((ThumbnailWrap/100)*ThumbItemMargin);
357		
358					$('.thumbnails-in li').css({
359						'width': ThumbnailWidth,
360						'marginLeft': ThumbnailMargin
361					});
362					$testSl.slick('reload');
363				}
364				$('.thumbnails-in li').each(function(){
365					var $this = $(this);
366						$this.find('img').on('click', function(){
367							if (!$this.hasClass('active-item')) {
368								$('.thumbnails-in li').removeClass('active-item');
369								$this.addClass('active-item');
370							}
371						});
372				});
373				
374		
375                
376                /*$(".quick-card-slider__items").lightGallery({
377                    thumbnail: false,
378                    download: true,
379                    loop: false,
380                    counter: false,
381                    getCaptionFromTitleOrAlt: true,
382                    selector: ".quick-card-slider__image a"
383                });*/
384                
385                // Слайдер и лупа 
386                
387            	if (typeof amountInit === "function") {
388            		amountInit();
389            	};
390                
391                if ($.isFunction(callback)) {
392                    callback();
393                };
394                
395                
396                var initPhotoSwipeFromDOM = function(gallerySelector) {
397	
398		var parseThumbnailElements = function(el) {
399		    var thumbElements = el.childNodes,
400		    	numNodes = thumbElements.length,
401		        items = [],
402		        el,
403		        childElements,
404		        thumbnailEl,
405		        size,
406		        item;
407		        
408		        
409		    for(var i = 0; i < numNodes; i++) {
410		        el = thumbElements[i];
411	
412		        // include only element nodes 
413		        if(el.nodeType !== 1) {
414		          continue;
415		        }
416	
417		        childElements = el.children;
418	
419		        size = el.getAttribute('data-size').split('x');
420	
421		        // create slide object
422		        item = {
423					src: el.getAttribute('href'),
424					w: parseInt(size[0], 10),
425					h: parseInt(size[1], 10)
426					//author: el.getAttribute('data-author')
427		        };
428	
429		        item.el = el; // save link to element for getThumbBoundsFn
430	
431		        if(childElements.length > 0) {
432		          item.msrc = childElements[0].getAttribute('src'); // thumbnail url
433		          if(childElements.length > 1) {
434		              item.title = childElements[1].innerHTML; // caption (contents of figure)
435		          }
436		        }
437	
438	
439				var mediumSrc = el.getAttribute('data-med');
440	          	if(mediumSrc) {
441	            	size = el.getAttribute('data-med-size').split('x');
442	            	// "medium-sized" image
443	            	item.m = {
444	              		src: mediumSrc,
445	              		w: parseInt(size[0], 10),
446	              		h: parseInt(size[1], 10)
447	            	};
448	          	}
449	          	// original image
450	          	item.o = {
451	          		src: item.src,
452	          		w: item.w,
453	          		h: item.h
454	          	};
455	
456		        items.push(item);
457		    }
458	
459		    return items;
460		};
461	
462		// find nearest parent element
463		var closest = function closest(el, fn) {
464		    return el && ( fn(el) ? el : closest(el.parentNode, fn) );
465		};
466	
467		var onThumbnailsClick = function(e) {
468		    e = e || window.event;
469		    e.preventDefault ? e.preventDefault() : e.returnValue = false;
470	
471		    var eTarget = e.target || e.srcElement;
472	
473		    var clickedListItem = closest(eTarget, function(el) {
474		        return el.tagName === 'A';
475		    });
476	
477		    if(!clickedListItem) {
478		        return;
479		    }
480	
481		    var clickedGallery = clickedListItem.parentNode;
482	
483		    var childNodes = clickedListItem.parentNode.childNodes,
484		        numChildNodes = childNodes.length,
485		        nodeIndex = 0,
486		        index;
487	
488		    for (var i = 0; i < numChildNodes; i++) {
489		        if(childNodes[i].nodeType !== 1) { 
490		            continue; 
491		        }
492	
493		        if(childNodes[i] === clickedListItem) {
494		            index = nodeIndex;
495		            break;
496		        }
497		        nodeIndex++;
498		    }
499	
500		    if(index >= 0) {
501		        openPhotoSwipe( index, clickedGallery );
502		    }
503		    return false;
504		};
505	
506		var photoswipeParseHash = function() {
507			var hash = window.location.hash.substring(1),
508		    params = {};
509	
510		    if(hash.length < 5) { // pid=1
511		        return params;
512		    }
513	
514		    var vars = hash.split('&');
515		    for (var i = 0; i < vars.length; i++) {
516		        if(!vars[i]) {
517		            continue;
518		        }
519		        var pair = vars[i].split('=');  
520		        if(pair.length < 2) {
521		            continue;
522		        }           
523		        params[pair[0]] = pair[1];
524		    }
525	
526		    if(params.gid) {
527		    	params.gid = parseInt(params.gid, 10);
528		    }
529	
530		    return params;
531		};
532	
533		var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
534		    var pswpElement = document.querySelectorAll('.pswp')[0],
535		        gallery,
536		        options,
537		        items;
538	
539			items = parseThumbnailElements(galleryElement);
540	
541		    // define options (if needed)
542		    options = {
543	
544		        galleryUID: galleryElement.getAttribute('data-pswp-uid'),
545	
546		        getThumbBoundsFn: function(index) {
547		            // See Options->getThumbBoundsFn section of docs for more info
548		            var thumbnail = items[index].el.children[0],
549		                pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
550		                rect = thumbnail.getBoundingClientRect(); 
551	
552		            return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
553		        },
554	
555		        /*addCaptionHTMLFn: function(item, captionEl, isFake) {
556					if(!item.title) {
557						captionEl.children[0].innerText = '';
558						return false;
559					}
560					captionEl.children[0].innerHTML = item.title +  '<br/><small>
560Photo: ' + item.author + '</small>';
561					return true;
562		        },*/
563				
564		    };
565	
566	
567		    if(fromURL) {
568		    	if(options.galleryPIDs) {
569		    		// parse real index when custom PIDs are used 
570		    		// https://photoswipe.com/documentation/faq.html#custom-pid-in-url
571		    		for(var j = 0; j < items.length; j++) {
572		    			if(items[j].pid == index) {
573		    				options.index = j;
574		    				break;
575		    			}
576		    		}
577			    } else {
578			    	options.index = parseInt(index, 10) - 1;
579			    }
580		    } else {
581		    	options.index = parseInt(index, 10);
582		    }
583	
584		    // exit if index not found
585		    if( isNaN(options.index) ) {
586		    	return;
587		    }
588	
589	
590	
591			var radios = document.getElementsByName('gallery-style');
592			for (var i = 0, length = radios.length; i < length; i++) {
593			    if (radios[i].checked) {
594			        if(radios[i].id == 'radio-all-controls') {
595	
596			        } else if(radios[i].id == 'radio-minimal-black') {
597			        	options.mainClass = 'pswp--minimal--dark';
598				        options.barsSize = {top:0,bottom:0};
599						options.captionEl = false;
600						options.fullscreenEl = false;
601						options.shareEl = false;
602						options.bgOpacity = 0.85;
603						options.tapToClose = true;
604						options.tapToToggleControls = false;
605			        }
606			        break;
607			    }
608			}
609	
610		    if(disableAnimation) {
611		        options.showAnimationDuration = 0;
612		    }
613	
614		    // Pass data to PhotoSwipe and initialize it
615		    gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
616	
617		    // see: http://photoswipe.com/documentation/responsive-images.html
618			var realViewportWidth,
619			    useLargeImages = true,
620			    firstResize = true,
621			    imageSrcWillChange;
622	
623			gallery.listen('beforeResize', function() {
624	
625				var dpiRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
626				dpiRatio = Math.min(dpiRatio, 2.5);
627			    realViewportWidth = gallery.viewportSize.x * dpiRatio;
628	
629	
630			    if(realViewportWidth >= 1200 || (!gallery.likelyTouchDevice && realViewportWidth > 800) || screen.width > 1200 ) {
631			    	if(!useLargeImages) {
632			    		useLargeImages = true;
633			        	imageSrcWillChange = true;
634			    	}
635			        
636			    } else {
637			    	if(useLargeImages) {
638			    		useLargeImages = true;
639			        	imageSrcWillChange = true;
640			    	}
641			    }
642	
643			    if(imageSrcWillChange && !firstResize) {
644			        gallery.invalidateCurrItems();
645			    }
646	
647			    if(firstResize) {
648			        firstResize = false;
649			    }
650	
651			    imageSrcWillChange = false;
652	
653			});
654	
655			gallery.listen('gettingData', function(index, item) {
656			    if( useLargeImages ) {
657			        item.src = item.o.src;
658			        item.w = item.o.w;
659			        item.h = item.o.h;
660			    } else {
661			        item.src = item.m.src;
662			        item.w = item.m.w;
663			        item.h = item.m.h;
664			    }
665			});
666	
667		    gallery.init();
668		};
669	
670		// select all gallery elements
671		var galleryElements = document.querySelectorAll( gallerySelector );
672		for(var i = 0, l = galleryElements.length; i < l; i++) {
673			galleryElements[i].setAttribute('data-pswp-uid', i+1);
674			galleryElements[i].onclick = onThumbnailsClick;
675		}
676		
677	
678		// Parse URL and open gallery if it contains #&pid=3&gid=1
679		var hashData = photoswipeParseHash();
680		if(hashData.pid && hashData.gid) {
681			openPhotoSwipe( hashData.pid,  galleryElements[ hashData.gid - 1 ], true, true );
682		}
683	};
684	
685	initPhotoSwipeFromDOM('.thumb-item2');
686	
687                
688                $('.quick-card-slider__items .slick-slide a').on('click', function(){
689                	console.log('oko1')
690				    let a = $(this).parents('.slick-slide').index();
691				    $('.thumb-item2 a').eq(a).click();
692				    return false;
693				})
694				
695				$('body').on('load', ready);
696				
697				function ready() {
698					var img = $('.thumb-item2 a.image_rd img');
699					
700					var widthHig = img.width() + 'x' + img.height();
701					
702					var el = $('.thumb-item2 a.image_rd');
703					
704					el.attr('data-size', widthHig);
705				  	el.attr('data-med-size', widthHig);
706				  	
707				  	console.log(widthHig)
708				  	setTimeout(function(){
709				  		$('.gr-image-zoom').removeClass('not-loaded');
710				  	}, 300);
711						
712				}
713            }
714        });
715    };
716
717    function reloadProduct(node) {
718        var $node = $(node),
719            kinds = shop2.product.getNodeData(node, 'kinds', true),
720            paramName = shop2.product.getNodeData(node, 'name'),
721            paramValue = shop2.product.getNodeData(node, 'value'),
722            $form = $node.closest('form'),
723            form = $form.get(0),
724            meta, kind_id, product_id;
725            
726        if (kinds && $.type(paramName) !== 'undefined' && $.type(paramValue) !== 'undefined' && form) {
727
728            if (form.elements.meta) {
729                meta = $.parseJSON(form.elements.meta.value);
730            }
731
732            product_id = form.elements.product_id.value;
733
734            $form.find('[name=submit]').prop('disabled', true);
735
736            kind_id = shop2.product.findKindId(product_id, kinds, paramName, paramValue, meta);
737
738            if (kind_id === 0) return false;
739
740            var url = window.location.protocol + "//" + window.location.host + shop2.uri + "/product/" + kind_id;
741
742            loadProduct(url, function () {
743                checkQuickViews(ind, item);
744            });
745        }
746    };
747
748    function checkQuickViews (ind, item) {
749    	var $item = item;
750    	var prev_product_caller,
751			next_product_caller;
752            
753        $('.popover-wrap.product-quick-view .popover-body .quick-card-page').prepend('<div class="product_caller_wrap"><div class="prev_product_caller gr-button-1 not_active">Предыдущий</div><div class="next_product_caller gr-button-1 not_active">Следующий</div></div>');
754        prev_product_caller = $('.popover-wrap.product-quick-view .popover-body').find(".prev_product_caller");
755        next_product_caller = $('.popover-wrap.product-quick-view .popover-body').find(".next_product_caller");
756    	
757    	/*mode folder and kinds*/
758	    	if ($item.parents('.product-list:not(.tns-slider):not(.slick-slider):not(.owl-carousel):not(.lightSlider)').length) {
759		    	if($item.parent().hasClass('.owl-item')) {
760					var prev_product = $item.parent().prev().length ? $item.parent().prev().find(quick_trigger_class) : null;	
761		    		var next_product = $item.parent().next().length ? $item.parent().next().find(quick_trigger_class) : null;	
762				} else {
763		    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
764		    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
765				}
766	    	};
767	    	
768	    	if ($item.parents('.kinds_slider:not(.tns-slider):not(.slick-slider):not(.owl-carousel):not(.lightSlider)').length) {
769		    	if($item.parent().hasClass('.owl-item')) {
770					var prev_product = $item.parent().prev().length ? $item.parent().prev().find(quick_trigger_class) : null;	
771		    		var next_product = $item.parent().next().length ? $item.parent().next().find(quick_trigger_class) : null;	
772				} else {
773		    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
774		    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
775				}
776	    	};
777    	/*mode folder and kinds*/
778    	
779    	/*tiny slider*/
780	    	/*/if ($item.parents('.product-list.tns-slider').length) {
781	    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
782	    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
783
784	    		if ($item.parents('.product-list.tns-slider').find('.shop2-product-item').attr('id')==undefined) {
785	    			$('.prev_product_caller, .next_product_caller').remove();
786	    		}
787	    	};
788	    	
789	    	
790	    	if ($item.parents('.kinds_slider.tns-slider').length) {
791	    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
792	    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
793
794	    		if ($item.parents('.kinds_slider.tns-slider').find('.kind-item').attr('id')==undefined) {
795	    			$('.prev_product_caller, .next_product_caller').remove();
796	    		}
797	    	};/*/
798		/*tiny slider*/
799		
800		/*slick slider*/
801			if ($item.closest('.product_list').length) {
802					console.log(123)
803				if($item.parent().hasClass('.owl-item')) {
804					var prev_product = $item.parent().prev().length ? $item.parent().prev().find(quick_trigger_class) : null;	
805		    		var next_product = $item.parent().next().length ? $item.parent().next().find(quick_trigger_class) : null;	
806				} else {
807		    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
808		    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
809				}
810
811	    	};
812		
813		
814	    	if ($item.parents('.kinds_slider').length) {
815	    		
816	    		if($item.parent().hasClass('.owl-item')) {
817					var prev_product = $item.parent().prev().length ? $item.parent().prev().find(quick_trigger_class) : null;	
818		    		var next_product = $item.parent().next().length ? $item.parent().next().find(quick_trigger_class) : null;	
819				} else {
820		    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
821		    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
822				}
823
824	    	};
825    	/*slick slider*/
826		
827		/*owl slider*/
828	    	/*if ($item.parents('.product_list .owl-stage-outer').length) {
829	    		$item = $item.parents('.owl-item');
830		console.log(123)
831	    		
832	    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
833	    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
834
835	    		if ($item.parents('.product_list.owl-carousel').find('.cloned').length>0) {
836	    			$('.prev_product_caller, .next_product_caller').remove();
837	    		}
838	    	}
839	    	
840	    	if ($item.parents('.kinds_slider .owl-stage-outer').length) {
841	    		$item = $item.parents('.owl-item');
842	    		
843	    		var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null;	
844	    		var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null;	
845
846	    		if ($item.parents('.kinds_slider .owl-stage-outer').find('.cloned').length>0) {
847	    			$('.prev_product_caller, .next_product_caller').remove();
848	    		}
849	    	}*/
850    	/*owl slider*/
851    	
852    	/*light slider*/
853            /*/if ($item.parents('.product-list.lightSlider').length) {
854                var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null; 
855                var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null; 
856
857                if ($item.parents('.product-list.lightSlider').find('.clone').length>0) {
858                    $('.prev_product_caller, .next_product_caller').remove();
859                }
860            };
861            
862            
863            if ($item.parents('.kinds_slider.lightSlider').length) {
864                var prev_product = $item.prev().length ? $item.prev().find(quick_trigger_class) : null; 
865                var next_product = $item.next().length ? $item.next().find(quick_trigger_class) : null; 
866
867                if ($item.parents('.kinds_slider.lightSlider').find('.clone').length>0) {
868                    $('.prev_product_caller, .next_product_caller').remove();
869                }
870            };/*/
871        /*light slider*/
872
873        if (prev_product) {
874            prev_product_caller.removeClass("not_active").on("click", function () {
875                prev_product.trigger("click");
876            });
877        };
878        if (next_product) {
879            next_product_caller.removeClass("not_active").on("click", function () {
880                next_product.trigger("click");
881            });
882        };
883        
884        /*setTimeout(function(){
885        	$('.form-top__one-click').on('click', function(e) {
886				if (shop2.mode == 'product') {
887					var productAmount = $(this).parents('.shop2-product').find('.shop2-product-amount input').val();
888				} else {
889					var productName = $(this).parents('.shop2-product-item').find('.product-item__name a').text();
890					var productAmount = $(this).parents('.shop2-product-item').find('.shop2-product-amount input').val();
891				}
892				var productLink = (shop2.mode!=="product") ? (document.location.origin)+$(this).closest('.shop2-product').find('input[name=product_link]').val() : (document.location.href);
893
894				$.ajax({
895					url: $(this).data('api-url'),
896					dataType: 'json',
897					success: function(response) {
898						if (!response.result.error) {
899							
900							$('.remodal[data-remodal-id="one-click"] .tpl-anketa').remove();
901							$(response.result.html).appendTo('.remodal[data-remodal-id="one-click"]');
902							
903							if (shop2.mode == 'product') {
904								var nameValue = $('.remodal[data-remodal-id="one-click"] .tpl-field__product-name input').val() + ', количество - ' + productAmount;
905							} else {
906								var nameValue = productName + ', количество - ' + productAmount;
907							}
908							
909							$('.remodal[data-remodal-id="one-click"] .tpl-field__product-name input').val(nameValue);
910							$('.remodal[data-remodal-id="one-click"] .tpl-field__product-link input').val(productLink);
911
912							s3From.initForms($('.remodal[data-remodal-id="one-click"]'), function(){
913								$('.remodal[data-remodal-id="one-click"] .tpl-field__product-name input').val(nameValue);
914							});
915							formDatePicker.init();
916						
917						}
918					}
919				});
920			});
921		
922			var $tabs = $('#product-tabs');
923
924		    $tabs.responsiveTabs({
925		        rotate: false,
926		        startCollapsed: 'accordion',
927		        collapsible: 'accordion',
928		        animation: 'slide',
929		        duration: 500,
930		        animationqueue: false,
931		        setHash: true,
932		        scrollToAccordion: true,
933		        scrollToAccordionOffset: 65
934		    });  
935        }, 800);*/
936        
937        setTimeout(function(){
938        	$('.shop-product-data__desc .r-tabs-accordion-title:first-child a').trigger('click');
939        }, 1000);
940    };
941});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.