Каталог файловtilda-catalog-1.1.js
10401 var optionName = optionsElement.querySelector('.js-product-option-name').textContent;10402 if (optionName) {10403 optionName = t_store_escapeQuote(optionName);10404 }10405 if (optionName.length > 1 && optionName.charAt(optionName.length - 1) == ':') {10406 optionName = optionName.substring(0, optionName.length - 1);10407 }10408 10409 var optionVariant = checkbox.name;10410 if (optionVariant) {10411 optionVariant = t_store_escapeQuote(optionVariant);
История файла и сравнение версий
optionVariant = optionVariant.replace(/(?:\r\n|\r|\n)/g, '');
10415 var optionPrice = checkbox.getAttribute('data-product-variant-price'); 10417 optionPrice = parseFloat(optionPrice); 10421 option: optionName, 10422 variant: optionVariant, 10423 price: optionPrice, 10425 options.push(optionObj); 10433 * Настраивает фиксированную кнопку 10435 * @param {string} recId 10436 * @param {Object} options 10439function t_store_fixedPopupButton(recId, options) { 10440 var rec = document.getElementById('rec' + recId); 10443 var ADDITIONAL_POPUP_HEIGHT = 130; 10444 var BTN_WRAPPER_HEIGHT = 90; 10445 var MOBILE_MAX_WIDTH = 560; 10446 var FIXED_BTN_CLASS = 't-store__prod-popup__btn-wrapper-fixed'; 10447 var bgColor = options?.popup_opts?.containerBgColor; 10449 var btnWrappers = rec.querySelectorAll('.t-store__prod-popup__btn-wrapper'); 10451 Array.prototype.forEach.call(btnWrappers, function (el) { 10452 el.classList.add(FIXED_BTN_CLASS); 10454 el.style.background = bgColor; 10459 document.getElementById('allrecords') !== rec.querySelector('.t-store__product-snippet') && 10460 document.getElementById('allrecords').contains(rec.querySelector('.t-store__product-snippet')); 10461 // если это попап, а не отдельная страница с товаром (сниппет), то добавляем слушателей событий открытия/закрытия попапа и дополнительные стили 10463 var popup = rec.querySelector('.t-popup'); 10464 var popupContainer = popup.querySelector('.t-popup__container'); 10466 var addStyle = function () { 10467 popupContainer.style.paddingBottom = BTN_WRAPPER_HEIGHT + ADDITIONAL_POPUP_HEIGHT + 'px'; 10468 popupContainer.style.cssText += ';transform:none !important;'; 10471 var resetStyle = function () { 10472 popupContainer.style.paddingBottom = ''; 10473 popupContainer.style.transform = ''; 10476 var handleResize = function () { 10477 if (window.innerWidth > MOBILE_MAX_WIDTH) { 10485 if (window.isMobile) { 10486 window.addEventListener('orientationchange', handleResize); 10489 popup.addEventListener(t_store_POPUP_SHOWED_EVENT_NAME, function () { 10490 setTimeout(function () { 10495 popup.addEventListener(t_store_POPUP_CLOSED_EVENT_NAME, function () { 10496 setTimeout(function () {