Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-blocks-page189718009.min.js

Код файла
Версия от 13.09.2026, 07:00:42 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
301function t1301_closePopup(body,popup){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');body.classList.remove('t-body_popupshowed');popup.classList.remove('t-popup_show');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);body.dispatchEvent(event);var currentUrl=window.location.href;var indexToRemove=currentUrl.indexOf('#!/tproduct/');if(/iPhone|iPad|iPod/i.test(navigator.userAgent)&&indexToRemove!==-1){indexToRemove=currentUrl.indexOf('%23!/tproduct/')}302currentUrl=currentUrl.substring(0,indexToRemove);setTimeout(function(){popup.scrollTop=0;popup.style.display='none';if(history.replaceState){window.history.replaceState('','',currentUrl)}},300);t_triggerEvent(popup,t1301_POPUP_CLOSED_EVENT_NAME)}303function t1301_fixedPopupButton(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var MOBILE_MAX_WIDTH=560;var popup=rec.querySelector('.t-popup');var popupContainer=popup.querySelector('.t-popup__container');var btnWrappers=rec.querySelectorAll('.t1301__btn-wrapper');Array.prototype.forEach.call(btnWrappers,function(el){el.classList.add('t1301__btn-wrapper-fixed')});function addStyle(){popupContainer.style.paddingBottom='90px';popupContainer.style.cssText+=';transform:none !important;'}304function resetStyle(){popupContainer.style.paddingBottom='';popupContainer.style.transform=''}305function handleResize(){if(window.innerWidth>MOBILE_MAX_WIDTH){resetStyle();return}306addStyle()}307
История файла и сравнение версий
  • 13.09.2026, 07:00:42 · 56c3b845
if(window.isMobile){window.addEventListener('orientationchange',handleResize)}
308popup.addEventListener(t1301_POPUP_SHOWED_EVENT_NAME,function(){setTimeout(function(){handleResize()})});popup.addEventListener(t1301_POPUP_CLOSED_EVENT_NAME,function(){resetStyle()});window.addEventListener('resize',handleResize)}
309function t1301_initQuantityInputs(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var quantityInputs=rec.querySelectorAll('.t-catalog__prod__quantity-input');Array.prototype.forEach.call(quantityInputs,function(input){var maxValue=parseInt(input.getAttribute('max'),10);var minValue=parseInt(input.getAttribute('min'),10);input.addEventListener('input',function(e){var value=parseInt(e.target.value,10);if(value>maxValue){input.value=99999;return}
310if(value<minValue){input.value=1}})})}
311var t1301_POPUP_SHOWED_EVENT_NAME='catalog:popupShowed';var t1301_POPUP_CLOSED_EVENT_NAME='catalog:popupClosed';function t1301__init(recid){t_onFuncLoad('t_prod__init',function(){t_prod__init(recid)});t1301_initPopup(recid);t1301__hoverZoom_init(recid);t1301__updateLazyLoad(recid);t1301_initQuantityInputs(recid);var rec=document.getElementById('rec'+recid);if(!rec)return;var quantityBtns=rec.querySelectorAll('.t1301__col .t-catalog__prod__quantity, .t1301__product-full .t-catalog__prod__quantity');if(quantityBtns.length){t_onFuncLoad('t_catalog_addProductQuantityEvents',function(){t1301_initProductQuantity(recid)})}
312var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event)}
313function t1301_initProductQuantity(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var productList=rec.querySelectorAll('.t1301__col, .t1301__product-full');Array.prototype.forEach.call(productList,function(product){t_catalog_addProductQuantityEvents(product)})}
314function t1301__showMore(recid){var rec=document.querySelector('#rec'+recid+' .t1301');if(!rec)return;var cardsShowLimit=parseInt(rec.getAttribute('data-show-count'),10);if(isNaN(cardsShowLimit)||cardsShowLimit<=0)return;var showMoreButton=rec.querySelector('.t1301__showmore');if(!showMoreButton)return;const showMoreTextContainer=showMoreButton.querySelector('.js-btn-txt');if(showMoreTextContainer){showMoreTextContainer.textContent=t1301__dict()}
315showMoreButton.style.removeProperty('display');var allProductCards=rec.querySelectorAll('.t1301__col');Array.prototype.forEach.call(allProductCards,function(productCard){productCard.style.display='none'});var cardsNumber=allProductCards.length;t1301__showSeparator(rec,cardsShowLimit);for(var i=0;i<cardsShowLimit;i++){if(allProductCards[i]){allProductCards[i].style.removeProperty('display')}}
316showMoreButton.addEventListener('click',function(){var currentColumns=rec.querySelectorAll('.t1301__col');var currentColumnsShowed=0;Array.prototype.forEach.call(currentColumns,function(column){if(column.style.display!=='none'){++currentColumnsShowed}});for(var i=0;i<cardsShowLimit+currentColumnsShowed;i++){if(allProductCards[i]){allProductCards[i].style.removeProperty('display')}}
317var event=document.createEvent('HTMLEvents');event.initEvent('displayChanged',!0,!1);rec.dispatchEvent(event);if(cardsShowLimit+currentColumnsShowed>=cardsNumber){showMoreButton.style.display='none'}
318t1301__showSeparator(rec,cardsShowLimit+currentColumnsShowed);if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}})}
319function t1301__showSeparator(rec,cardsShowLimit){if(window.jQuery&&rec instanceof jQuery){rec=rec.get(0)}
320var allSeparators=rec.querySelectorAll('.t1301__separator_number');Array.prototype.forEach.call(allSeparators,function(separator){separator.classList.add('t1301__separator_hide');if(separator.getAttribute('data-product-separator-number')<=cardsShowLimit){separator.classList.remove('t1301__separator_hide')}})}
321function t1301__dict(){var dictionary={EN:'Load more',RU:'Загрузить еще',FR:'Charger plus',DE:'Mehr laden',ES:'Carga más',PT:'Carregue mais',UK:'Завантажити ще',JA:'もっと読み込む',ZH:'裝載更多',};var language=window.browserLang;return dictionary[language]?dictionary[language]:dictionary.EN}
322function t1301__hoverZoom_init(recid){if(window.isMobile)return;var rec=document.getElementById('rec'+recid);if(!rec)return;try{if(!rec.querySelector('[data-hover-zoom]')){return}
323var hoverScript='https://static.tildacdn.com/js/tilda-hover-zoom-1.0.min.js';if(document.querySelector("script[src^='"+hoverScript+"']")){t_onFuncLoad('t_hoverZoom_init',function(){t_hoverZoom_init(recid)})}else{var script=document.createElement('script');script.type='text/javascript';script.src=hoverScript;script.onload=function(){setTimeout(function(){t_hoverZoom_init(recid)},500)};script.onerror=function(error){console.log('Upload script error: ',error)};document.head.appendChild(script)}}catch(error){console.log('Zoom image init error: '+error.message)}}
324function t1301__updateLazyLoad(recid){var scrollContainer=document.querySelector('#rec'+recid+' .t1301__container_mobile-flex');var tRecords=document.querySelector('.t-records');if(!tRecords)return;var currentMode=tRecords.getAttribute('data-tilda-mode');var colFixed=document.querySelector('#rec'+recid+' .t1301__col_fixed');var allRecords=document.getElementById('allrecords');var scrollFunc=t_throttle(function(){if(window.lazy==='y'||(allRecords&&allRecords.getAttribute('data-tilda-lazy')==='yes')){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}});if(currentMode!=='edit'&&currentMode!=='preview'){if(scrollContainer)scrollContainer.addEventListener('scroll',scrollFunc);if(colFixed){var popup=document.querySelector('#rec'+recid+' .t-popup');if(popup)popup.addEventListener('scroll',scrollFunc)}}}
325function t1301_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var allPopupLinks=rec.querySelectorAll('[href^="#prodpopup"]');if(!allPopupLinks.length)return;var popup=rec.querySelector('.t-popup');popup.addEventListener('mousedown',function(event){var windowWidth=window.innerWidth;var maxScrollBarWidth=17;var windowWithoutScrollBar=windowWidth-maxScrollBarWidth;if(event.clientX>windowWithoutScrollBar){return}
326if(event.target===this){t1301_closePopup(document.body,popup)}});Array.prototype.forEach.call(allPopupLinks,function(popupLink){var product=popupLink.closest('.js-product');var productLid=product.getAttribute('data-product-lid');var productLinks=document.querySelectorAll('.r a[href$="#!/tproduct/'+recid+'-'+productLid+'"]');Array.prototype.forEach.call(productLinks,function(productLink){productLink.addEventListener('click',function(){if(rec.querySelector('[data-product-lid="'+productLid+'"]')){var linkToPopup=product.querySelector('[href^="#prodpopup"]');if(linkToPopup){var event=document.createEvent('HTMLEvents');event.initEvent('click',!0,!1);linkToPopup.dispatchEvent(event)}}})});popupLink.addEventListener('click',clickOnceHandler,{once:!0});function clickOnceHandler(event){event.preventDefault();t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid+' #t1301__product-'+productLid)});popupLink.removeEventListener('click',clickOnceHandler,!1)}
327popupLink.addEventListener('click',function(event){event.preventDefault();if(event.target.classList.contains('t1002__addBtn')||event.target.parentNode.classList.contains('t1002__addBtn')){return}
328t1301_showPopup(recid);Array.prototype.forEach.call(popup.querySelectorAll('.js-product'),function(product){product.style.display='none'});var productFull=popup.querySelector('.js-product[data-product-lid="'+productLid+'"]');if(productFull){productFull.style.display='block'}
329var analitics=popup.getAttribute('data-track-popup');if(analitics&&productFull&&window.Tilda){var productName=productFull.querySelector('.js-product-name');if(productName){var virtualTitle=productName.textContent;if(!virtualTitle){virtualTitle='prod'+productLid}
330Tilda.sendEventToStatistics(analitics,virtualTitle)}}
331var currentUrl=window.location.href;if(currentUrl.indexOf('#!/tproduct/')===-1&&currentUrl.indexOf('%23!/tproduct/')===-1){if(history.replaceState){var baseUrl=currentUrl.split('#')[0];window.history.replaceState('','',baseUrl+'#!/tproduct/'+recid+'-'+productLid)}}
332t1301_updateSlider(recid+' #t1301__product-'+productLid);setTimeout(function(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},500)})});if(!document.getElementById('record'+recid)){t1301_checkUrl(recid)}
333if(popup&&popup.hasAttribute('data-fixed-button')){t1301_fixedPopupButton(recid)}}
334function t1301_checkUrl(recid){if(!window.catalogUrlProcessedByRecid){window.catalogUrlProcessedByRecid={}}
335if(window.catalogUrlProcessedByRecid[recid])return;var currentUrl=window.location.href;var tprodIndex=(currentUrl.indexOf('#!/tproduct/')+1||currentUrl.indexOf('%23!/tproduct/')+1||currentUrl.indexOf('#%21%2Ftproduct%2F')+1||currentUrl.indexOf('#!%2Ftproduct%2F')+1||currentUrl.indexOf('%23%21%2Ftproduct%2F')+1)-1;if(tprodIndex!==-1){var currentUrl=currentUrl.substring(tprodIndex,currentUrl.length);var curProdLid=currentUrl.substring(currentUrl.indexOf('-')+1,currentUrl.length);if(curProdLid){var curProdLidMatch=curProdLid.match(/([0-9]+)/g);if(curProdLidMatch){curProdLid=curProdLidMatch[0]}}
336if(currentUrl.indexOf(recid)===-1)return;var rec=document.getElementById('rec'+recid);if(!rec)return;if(currentUrl.indexOf(recid)!==0&&rec.querySelector('[data-product-lid="'+curProdLid+'"]')){var currentLink=rec.querySelector('[data-product-lid="'+curProdLid+'"] [href^="#prodpopup"]');var event=document.createEvent('HTMLEvents');event.initEvent('click',!0,!1);if(currentLink){currentLink.dispatchEvent(event)}
337if(typeof rec.scrollIntoView==='function'){rec.scrollIntoView({block:'start'})}
338window.catalogUrlProcessedByRecid[recid]=!0}}}
339function t1301_updateSlider(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;t_onFuncLoad('t_slds_SliderWidth',function(){t_slds_SliderWidth(recid)});var sliderWrapper=rec.querySelector('.t-slds__items-wrapper');var slider=rec.querySelector('.t-slds__container');var paddingLeft=parseInt(slider.style.paddingLeft,10)||0;var paddingRight=parseInt(slider.style.paddingRight,10)||0;var sliderWidth=slider.clientWidth-(paddingLeft+paddingRight);var position=parseInt(sliderWrapper.getAttribute('data-slider-pos'),10);sliderWrapper.style.transform='translate3d(-'+sliderWidth*position+'px, 0, 0)';t_onFuncLoad('t_slds_UpdateSliderHeight',function(){t_slds_UpdateSliderHeight(recid)});t_onFuncLoad('t_slds_UpdateSliderArrowsHeight',function(){t_slds_UpdateSliderArrowsHeight(recid)})}
340function t1301_showPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var popup=rec.querySelector('.t-popup');popup.style.display='block';setTimeout(function(){popup.querySelector('.t-popup__container').classList.add('t-popup__container-animated');popup.classList.add('t-popup_show');t_triggerEvent(popup,t1301_POPUP_SHOWED_EVENT_NAME)},50);setTimeout(function(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},300);if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event);var closeButtons=document.querySelectorAll('.t-popup__close, .t1301__close-text');Array.prototype.forEach.call(closeButtons,function(closeButton){closeButton.addEventListener('click',function(){t1301_closePopup(document.body,popup)})});document.addEventListener('keydown',function(event){var isGalleryShowedOldLib=document.body.classList.contains('t-zoomer__show');if(isGalleryShowedOldLib)return;var isGalleryShowedNewLib=document.body.classList.contains('t-zoomer__active');if(isGalleryShowedNewLib)return;var isPopupShowed=document.body.classList.contains('t-body_popupshowed');if(!isPopupShowed)return;if(popup&&popup.classList.contains('t-popup_show')){if(event.key==='Escape'){t1301_closePopup(document.body,popup)}}})}
341function t1301_closePopup(body,popup){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');body.classList.remove('t-body_popupshowed');popup.classList.remove('t-popup_show');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);body.dispatchEvent(event);var currentUrl=window.location.href;var indexToRemove=currentUrl.indexOf('#!/tproduct/');if(/iPhone|iPad|iPod/i.test(navigator.userAgent)&&indexToRemove!==-1){indexToRemove=currentUrl.indexOf('%23!/tproduct/')}
342currentUrl=currentUrl.substring(0,indexToRemove);setTimeout(function(){popup.scrollTop=0;popup.style.display='none';if(history.replaceState){window.history.replaceState('','',currentUrl)}},300);t_triggerEvent(popup,t1301_POPUP_CLOSED_EVENT_NAME)}
343function t1301_fixedPopupButton(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var MOBILE_MAX_WIDTH=560;var popup=rec.querySelector('.t-popup');var popupContainer=popup.querySelector('.t-popup__container');var btnWrappers=rec.querySelectorAll('.t1301__btn-wrapper');Array.prototype.forEach.call(btnWrappers,function(el){el.classList.add('t1301__btn-wrapper-fixed')});function addStyle(){popupContainer.style.paddingBottom='90px';popupContainer.style.cssText+=';transform:none !important;'}
344function resetStyle(){popupContainer.style.paddingBottom='';popupContainer.style.transform=''}
345function handleResize(){if(window.innerWidth>MOBILE_MAX_WIDTH){resetStyle();return}
346addStyle()}
347if(window.isMobile){window.addEventListener('orientationchange',handleResize)}
348popup.addEventListener(t1301_POPUP_SHOWED_EVENT_NAME,function(){setTimeout(function(){handleResize()})});popup.addEventListener(t1301_POPUP_CLOSED_EVENT_NAME,function(){resetStyle()});window.addEventListener('resize',handleResize)}
349function t1301_initQuantityInputs(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var quantityInputs=rec.querySelectorAll('.t-catalog__prod__quantity-input');Array.prototype.forEach.call(quantityInputs,function(input){var maxValue=parseInt(input.getAttribute('max'),10);var minValue=parseInt(input.getAttribute('min'),10);input.addEventListener('input',function(e){var value=parseInt(e.target.value,10);if(value>maxValue){input.value=99999;return}
350if(value<minValue){input.value=1}})})}
351var t1301_POPUP_SHOWED_EVENT_NAME='catalog:popupShowed';var t1301_POPUP_CLOSED_EVENT_NAME='catalog:popupClosed';function t1301__init(recid){t_onFuncLoad('t_prod__init',function(){t_prod__init(recid)});t1301_initPopup(recid);t1301__hoverZoom_init(recid);t1301__updateLazyLoad(recid);t1301_initQuantityInputs(recid);var rec=document.getElementById('rec'+recid);if(!rec)return;var quantityBtns=rec.querySelectorAll('.t1301__col .t-catalog__prod__quantity, .t1301__product-full .t-catalog__prod__quantity');if(quantityBtns.length){t_onFuncLoad('t_catalog_addProductQuantityEvents',function(){t1301_initProductQuantity(recid)})}
352var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event)}
353function t1301_initProductQuantity(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var productList=rec.querySelectorAll('.t1301__col, .t1301__product-full');Array.prototype.forEach.call(productList,function(product){t_catalog_addProductQuantityEvents(product)})}
354function t1301__showMore(recid){var rec=document.querySelector('#rec'+recid+' .t1301');if(!rec)return;var cardsShowLimit=parseInt(rec.getAttribute('data-show-count'),10);if(isNaN(cardsShowLimit)||cardsShowLimit<=0)return;var showMoreButton=rec.querySelector('.t1301__showmore');if(!showMoreButton)return;const showMoreTextContainer=showMoreButton.querySelector('.js-btn-txt');if(showMoreTextContainer){showMoreTextContainer.textContent=t1301__dict()}
355showMoreButton.style.removeProperty('display');var allProductCards=rec.querySelectorAll('.t1301__col');Array.prototype.forEach.call(allProductCards,function(productCard){productCard.style.display='none'});var cardsNumber=allProductCards.length;t1301__showSeparator(rec,cardsShowLimit);for(var i=0;i<cardsShowLimit;i++){if(allProductCards[i]){allProductCards[i].style.removeProperty('display')}}
356showMoreButton.addEventListener('click',function(){var currentColumns=rec.querySelectorAll('.t1301__col');var currentColumnsShowed=0;Array.prototype.forEach.call(currentColumns,function(column){if(column.style.display!=='none'){++currentColumnsShowed}});for(var i=0;i<cardsShowLimit+currentColumnsShowed;i++){if(allProductCards[i]){allProductCards[i].style.removeProperty('display')}}
357var event=document.createEvent('HTMLEvents');event.initEvent('displayChanged',!0,!1);rec.dispatchEvent(event);if(cardsShowLimit+currentColumnsShowed>=cardsNumber){showMoreButton.style.display='none'}
358t1301__showSeparator(rec,cardsShowLimit+currentColumnsShowed);if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}})}
359function t1301__showSeparator(rec,cardsShowLimit){if(window.jQuery&&rec instanceof jQuery){rec=rec.get(0)}
360var allSeparators=rec.querySelectorAll('.t1301__separator_number');Array.prototype.forEach.call(allSeparators,function(separator){separator.classList.add('t1301__separator_hide');if(separator.getAttribute('data-product-separator-number')<=cardsShowLimit){separator.classList.remove('t1301__separator_hide')}})}
361function t1301__dict(){var dictionary={EN:'Load more',RU:'Загрузить еще',FR:'Charger plus',DE:'Mehr laden',ES:'Carga más',PT:'Carregue mais',UK:'Завантажити ще',JA:'もっと読み込む',ZH:'裝載更多',};var language=window.browserLang;return dictionary[language]?dictionary[language]:dictionary.EN}
362function t1301__hoverZoom_init(recid){if(window.isMobile)return;var rec=document.getElementById('rec'+recid);if(!rec)return;try{if(!rec.querySelector('[data-hover-zoom]')){return}
363var hoverScript='https://static.tildacdn.com/js/tilda-hover-zoom-1.0.min.js';if(document.querySelector("script[src^='"+hoverScript+"']")){t_onFuncLoad('t_hoverZoom_init',function(){t_hoverZoom_init(recid)})}else{var script=document.createElement('script');script.type='text/javascript';script.src=hoverScript;script.onload=function(){setTimeout(function(){t_hoverZoom_init(recid)},500)};script.onerror=function(error){console.log('Upload script error: ',error)};document.head.appendChild(script)}}catch(error){console.log('Zoom image init error: '+error.message)}}
364function t1301__updateLazyLoad(recid){var scrollContainer=document.querySelector('#rec'+recid+' .t1301__container_mobile-flex');var tRecords=document.querySelector('.t-records');if(!tRecords)return;var currentMode=tRecords.getAttribute('data-tilda-mode');var colFixed=document.querySelector('#rec'+recid+' .t1301__col_fixed');var allRecords=document.getElementById('allrecords');var scrollFunc=t_throttle(function(){if(window.lazy==='y'||(allRecords&&allRecords.getAttribute('data-tilda-lazy')==='yes')){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}});if(currentMode!=='edit'&&currentMode!=='preview'){if(scrollContainer)scrollContainer.addEventListener('scroll',scrollFunc);if(colFixed){var popup=document.querySelector('#rec'+recid+' .t-popup');if(popup)popup.addEventListener('scroll',scrollFunc)}}}
365function t1301_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var allPopupLinks=rec.querySelectorAll('[href^="#prodpopup"]');if(!allPopupLinks.length)return;var popup=rec.querySelector('.t-popup');popup.addEventListener('mousedown',function(event){var windowWidth=window.innerWidth;var maxScrollBarWidth=17;var windowWithoutScrollBar=windowWidth-maxScrollBarWidth;if(event.clientX>windowWithoutScrollBar){return}
366if(event.target===this){t1301_closePopup(document.body,popup)}});Array.prototype.forEach.call(allPopupLinks,function(popupLink){var product=popupLink.closest('.js-product');var productLid=product.getAttribute('data-product-lid');var productLinks=document.querySelectorAll('.r a[href$="#!/tproduct/'+recid+'-'+productLid+'"]');Array.prototype.forEach.call(productLinks,function(productLink){productLink.addEventListener('click',function(){if(rec.querySelector('[data-product-lid="'+productLid+'"]')){var linkToPopup=product.querySelector('[href^="#prodpopup"]');if(linkToPopup){var event=document.createEvent('HTMLEvents');event.initEvent('click',!0,!1);linkToPopup.dispatchEvent(event)}}})});popupLink.addEventListener('click',clickOnceHandler,{once:!0});function clickOnceHandler(event){event.preventDefault();t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid+' #t1301__product-'+productLid)});popupLink.removeEventListener('click',clickOnceHandler,!1)}
367popupLink.addEventListener('click',function(event){event.preventDefault();if(event.target.classList.contains('t1002__addBtn')||event.target.parentNode.classList.contains('t1002__addBtn')){return}
368t1301_showPopup(recid);Array.prototype.forEach.call(popup.querySelectorAll('.js-product'),function(product){product.style.display='none'});var productFull=popup.querySelector('.js-product[data-product-lid="'+productLid+'"]');if(productFull){productFull.style.display='block'}
369var analitics=popup.getAttribute('data-track-popup');if(analitics&&productFull&&window.Tilda){var productName=productFull.querySelector('.js-product-name');if(productName){var virtualTitle=productName.textContent;if(!virtualTitle){virtualTitle='prod'+productLid}
370Tilda.sendEventToStatistics(analitics,virtualTitle)}}
371var currentUrl=window.location.href;if(currentUrl.indexOf('#!/tproduct/')===-1&&currentUrl.indexOf('%23!/tproduct/')===-1){if(history.replaceState){var baseUrl=currentUrl.split('#')[0];window.history.replaceState('','',baseUrl+'#!/tproduct/'+recid+'-'+productLid)}}
372t1301_updateSlider(recid+' #t1301__product-'+productLid);setTimeout(function(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},500)})});if(!document.getElementById('record'+recid)){t1301_checkUrl(recid)}
373if(popup&&popup.hasAttribute('data-fixed-button')){t1301_fixedPopupButton(recid)}}
374function t1301_checkUrl(recid){if(!window.catalogUrlProcessedByRecid){window.catalogUrlProcessedByRecid={}}
375if(window.catalogUrlProcessedByRecid[recid])return;var currentUrl=window.location.href;var tprodIndex=(currentUrl.indexOf('#!/tproduct/')+1||currentUrl.indexOf('%23!/tproduct/')+1||currentUrl.indexOf('#%21%2Ftproduct%2F')+1||currentUrl.indexOf('#!%2Ftproduct%2F')+1||currentUrl.indexOf('%23%21%2Ftproduct%2F')+1)-1;if(tprodIndex!==-1){var currentUrl=currentUrl.substring(tprodIndex,currentUrl.length);var curProdLid=currentUrl.substring(currentUrl.indexOf('-')+1,currentUrl.length);if(curProdLid){var curProdLidMatch=curProdLid.match(/([0-9]+)/g);if(curProdLidMatch){curProdLid=curProdLidMatch[0]}}
376if(currentUrl.indexOf(recid)===-1)return;var rec=document.getElementById('rec'+recid);if(!rec)return;if(currentUrl.indexOf(recid)!==0&&rec.querySelector('[data-product-lid="'+curProdLid+'"]')){var currentLink=rec.querySelector('[data-product-lid="'+curProdLid+'"] [href^="#prodpopup"]');var event=document.createEvent('HTMLEvents');event.initEvent('click',!0,!1);if(currentLink){currentLink.dispatchEvent(event)}
377if(typeof rec.scrollIntoView==='function'){rec.scrollIntoView({block:'start'})}
378window.catalogUrlProcessedByRecid[recid]=!0}}}
379function t1301_updateSlider(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;t_onFuncLoad('t_slds_SliderWidth',function(){t_slds_SliderWidth(recid)});var sliderWrapper=rec.querySelector('.t-slds__items-wrapper');var slider=rec.querySelector('.t-slds__container');var paddingLeft=parseInt(slider.style.paddingLeft,10)||0;var paddingRight=parseInt(slider.style.paddingRight,10)||0;var sliderWidth=slider.clientWidth-(paddingLeft+paddingRight);var position=parseInt(sliderWrapper.getAttribute('data-slider-pos'),10);sliderWrapper.style.transform='translate3d(-'+sliderWidth*position+'px, 0, 0)';t_onFuncLoad('t_slds_UpdateSliderHeight',function(){t_slds_UpdateSliderHeight(recid)});t_onFuncLoad('t_slds_UpdateSliderArrowsHeight',function(){t_slds_UpdateSliderArrowsHeight(recid)})}
380function t1301_showPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var popup=rec.querySelector('.t-popup');popup.style.display='block';setTimeout(function(){popup.querySelector('.t-popup__container').classList.add('t-popup__container-animated');popup.classList.add('t-popup_show');t_triggerEvent(popup,t1301_POPUP_SHOWED_EVENT_NAME)},50);setTimeout(function(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},300);if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event);var closeButtons=document.querySelectorAll('.t-popup__close, .t1301__close-text');Array.prototype.forEach.call(closeButtons,function(closeButton){closeButton.addEventListener('click',function(){t1301_closePopup(document.body,popup)})});document.addEventListener('keydown',function(event){var isGalleryShowedOldLib=document.body.classList.contains('t-zoomer__show');if(isGalleryShowedOldLib)return;var isGalleryShowedNewLib=document.body.classList.contains('t-zoomer__active');if(isGalleryShowedNewLib)return;var isPopupShowed=document.body.classList.contains('t-body_popupshowed');if(!isPopupShowed)return;if(popup&&popup.classList.contains('t-popup_show')){if(event.key==='Escape'){t1301_closePopup(document.body,popup)}}})}
381function t1301_closePopup(body,popup){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');body.classList.remove('t-body_popupshowed');popup.classList.remove('t-popup_show');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);body.dispatchEvent(event);var currentUrl=window.location.href;var indexToRemove=currentUrl.indexOf('#!/tproduct/');if(/iPhone|iPad|iPod/i.test(navigator.userAgent)&&indexToRemove!==-1){indexToRemove=currentUrl.indexOf('%23!/tproduct/')}
382currentUrl=currentUrl.substring(0,indexToRemove);setTimeout(function(){popup.scrollTop=0;popup.style.display='none';if(history.replaceState){window.history.replaceState('','',currentUrl)}},300);t_triggerEvent(popup,t1301_POPUP_CLOSED_EVENT_NAME)}
383function t1301_fixedPopupButton(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var MOBILE_MAX_WIDTH=560;var popup=rec.querySelector('.t-popup');var popupContainer=popup.querySelector('.t-popup__container');var btnWrappers=rec.querySelectorAll('.t1301__btn-wrapper');Array.prototype.forEach.call(btnWrappers,function(el){el.classList.add('t1301__btn-wrapper-fixed')});function addStyle(){popupContainer.style.paddingBottom='90px';popupContainer.style.cssText+=';transform:none !important;'}
384function resetStyle(){popupContainer.style.paddingBottom='';popupContainer.style.transform=''}
385function handleResize(){if(window.innerWidth>MOBILE_MAX_WIDTH){resetStyle();return}
386addStyle()}
387if(window.isMobile){window.addEventListener('orientationchange',handleResize)}
388popup.addEventListener(t1301_POPUP_SHOWED_EVENT_NAME,function(){setTimeout(function(){handleResize()})});popup.addEventListener(t1301_POPUP_CLOSED_EVENT_NAME,function(){resetStyle()});window.addEventListener('resize',handleResize)}
389function t1301_initQuantityInputs(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var quantityInputs=rec.querySelectorAll('.t-catalog__prod__quantity-input');Array.prototype.forEach.call(quantityInputs,function(input){var maxValue=parseInt(input.getAttribute('max'),10);var minValue=parseInt(input.getAttribute('min'),10);input.addEventListener('input',function(e){var value=parseInt(e.target.value,10);if(value>maxValue){input.value=99999;return}
390if(value<minValue){input.value=1}})})}
391function t780_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;if(rec.querySelector('.t-slds')){t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid)})}
392setTimeout(function(){t_onFuncLoad('t_prod__init',function(){t_prod__init(recid)});var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event)},500);var wrapperBlock=rec.querySelector('.t780');if(wrapperBlock){wrapperBlock.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)})})}}
393function t756_init(recid){t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid)});setTimeout(function(){t_onFuncLoad('t_prod__init',function(){t_prod__init(recid)});t756_initPopup(recid);var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event)},500)}
394function t756_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;rec.setAttribute('data-animationappear','off');rec.style.opacity='1';var popup=rec.querySelector('.t-popup');if(!popup)return;var hook=popup.getAttribute('data-tooltip-hook');var analitics=popup.getAttribute('data-track-popup');if(!hook)return;t_onFuncLoad('t_popup__addAttributesForAccessibility',function(){t_popup__addAttributesForAccessibility(hook)});document.addEventListener('click',function(event){var target=event.target.closest('a[href="'+hook+'"]');if(target){t756_showPopup(recid);event.preventDefault();if(analitics&&window.Tilda){var virtualTitle=hook;if(virtualTitle.substring(0,7)==='#popup:'){virtualTitle=virtualTitle.substring(7)}
395Tilda.sendEventToStatistics(analitics,virtualTitle)}}});t_onFuncLoad('t_popup__addClassOnTriggerButton',function(){t_popup__addClassOnTriggerButton(document,hook)});popup.addEventListener('mousedown',function(event){var windowWidth=window.innerWidth;var maxScrollBarWidth=17;var windowWithoutScrollBar=windowWidth-maxScrollBarWidth;if(event.clientX>windowWithoutScrollBar){return}
396if(event.target===this){t756_closePopup(recid)}});var closeButtons=rec.querySelectorAll('.t-popup__close, .t756__close-text');Array.prototype.forEach.call(closeButtons,function(button){button.addEventListener('click',function(){t756_closePopup(recid)})});var orderLinks=rec.querySelectorAll('a[href*="#"]');Array.prototype.forEach.call(orderLinks,function(link){link.addEventListener('click',linkHandler,!1);function linkHandler(){var orderUrl=link.getAttribute('href');if(!orderUrl||(orderUrl.substring(0,7)!=='#price:'&&orderUrl.substring(0,15)!=='#addtofavorites')){t756_closePopup(recid);if(!orderUrl||orderUrl.substring(0,7)==='#popup:'){setTimeout(function(){document.body.classList.add('t-body_popupshowed')},300)}
397if(window.navigator.userAgent.indexOf('Android')!==-1&&orderUrl.slice(0,4)==='#rec'){var elem=document.getElementById(orderUrl.replace('#',''));if(!elem)return;var elemTopPos=elem.getBoundingClientRect().top+window.pageYOffset;if(elemTopPos)window.scrollTo(0,parseInt(elemTopPos,10))}}}});document.addEventListener('keydown',function(event){var isGalarryShowed=document.body.classList.contains('t-zoomer__show');if(isGalarryShowed)return;var isPopupShowed=document.body.classList.contains('t-body_popupshowed');if(!isPopupShowed)return;if(event.keyCode===27){t756_closePopup(recid)}})}
398function t756_showPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var popup=rec.querySelector('.t-popup');popup.style.display='block';setTimeout(function(){popup.querySelector('.t-popup__container').classList.add('t-popup__container-animated');popup.classList.add('t-popup_show');popup.focus();t_onFuncLoad('t_popup__trapFocus',function(){t_popup__trapFocus(popup)});t_onFuncLoad('t_slds_SliderWidth',function(){t_slds_SliderWidth(recid)});var sliderWrapper=rec.querySelector('.t-slds__items-wrapper');var position=parseInt(sliderWrapper.getAttribute('data-slider-pos'),10);var slider=rec.querySelector('.t-slds__container');var paddingLeft=parseInt(slider.style.paddingLeft,10)||0;var paddingRight=parseInt(slider.style.paddingRight,10)||0;var sliderWidth=slider.clientWidth-(paddingLeft+paddingRight);sliderWrapper.style.transform='translate3d(-'+sliderWidth*position+'px, 0, 0)';t_onFuncLoad('t_slds_UpdateSliderHeight',function(){t_slds_UpdateSliderHeight(recid)});t_onFuncLoad('t_slds_UpdateSliderArrowsHeight',function(){t_slds_UpdateSliderArrowsHeight(recid)});if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},50);var body=document.body;if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');body.classList.add('t-body_popupshowed');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);body.dispatchEvent(event)}
399function t756_closePopup(recid){var body=document.body;if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');body.classList.remove('t-body_popupshowed');var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);body.dispatchEvent(event);var rec=document.getElementById('rec'+recid);if(!rec)return;var allPopups=document.querySelectorAll('.t-popup');allPopups.forEach(function(popup){popup.classList.remove('t-popup_show')});t_onFuncLoad('t_popup__addFocusOnTriggerButton',function(){t_popup__addFocusOnTriggerButton()});setTimeout(function(){var hiddenPopups=document.querySelectorAll('.t-popup:not(.t-popup_show)');hiddenPopups.forEach(function(popup){popup.style.display='none'})},300)}
400function t766_init(recid){t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid)});setTimeout(function(){t_onFuncLoad('t_prod__init',function(){t_prod__init(recid)});t766_initPopup(recid);var event=document.createEvent('HTMLEvents');event.initEvent('twishlist_addbtn',!0,!1);document.body.dispatchEvent(event)},500)}
Предыдущие 100 строкСледующие 100 строк