3501var wrapper = rec.querySelector('.t-store__grid-cont_itemwrapper');3502if (!wrapper) return;35033504var items = wrapper.querySelectorAll('.js-product');3505if (3506items &&3507items.length &&3508(items[0].classList.contains('t-store__card_fixed-width') ||3509items[0].classList.contains('t-store__card_under-description'))3510) {3511return;3512
} var maxWidth = 0; var maxPriceWidth = 0; var maxButtonsWidth = 0; Array.prototype.forEach.call(items, function (item) { var col = item.querySelector('.t-store__card__price-buttons'); if (col) { if (col.classList.contains('t-store__card__price-buttons_in-row')) { var price = col.querySelector('.t-store__card__price-wrapper'); var buttons = col.querySelector('.t-store__card__btns-wrapper'); if (price) price.style.width = null; if (buttons) buttons.style.width = null; col.style.width = null; } else { col.style.width = null; } } }); Array.prototype.forEach.call(items, function (item) { var col = item.querySelector('.t-store__card__price-buttons'); if (col) { if (col.classList.contains('t-store__card__price-buttons_in-row')) { var price = col.querySelector('.t-store__card__price-wrapper'); var buttons = col.querySelector('.t-store__card__btns-wrapper'); if (price) { var priceStyle = window.getComputedStyle(price); var priceWidth = Math.ceil(parseFloat(priceStyle.width)) + Math.ceil(parseFloat(priceStyle.marginRight)); if (priceWidth > maxPriceWidth) maxPriceWidth = priceWidth; } if (buttons) { var buttonsWidth = Math.ceil(parseFloat(window.getComputedStyle(buttons).width)); if (buttonsWidth > maxButtonsWidth) maxButtonsWidth = buttonsWidth; } } else { var curWidth = Math.ceil(parseFloat(window.getComputedStyle(col).width)); if (curWidth > maxWidth) maxWidth = curWidth; } } }); Array.prototype.forEach.call(items, function (item) { var col = item.querySelector('.t-store__card__price-buttons'); if (col) { if (col.classList.contains('t-store__card__price-buttons_in-row')) { var price = col.querySelector('.t-store__card__price-wrapper'); var buttons = col.querySelector('.t-store__card__btns-wrapper'); if (price) price.style.width = maxPriceWidth + 'px'; if (buttons) buttons.style.width = maxButtonsWidth + 'px'; col.style.width = maxPriceWidth + maxButtonsWidth + 'px'; } else { col.style.width = maxWidth + 'px'; } } });}/** * Initialize the popup for the product * * @param {string} recid * @param {object} obj_products - The products that are shown in the popup. * @param {TildaStoreOptions} options * @param {boolean} isRelevantsShow * @param {object} obj **/function t_store_initPopup(recid, obj_products, options, isRelevantsShow, obj) { if (!isRelevantsShow) { window.urlBeforePopupOpen = window.location.href; window.titleBeforePopupOpen = document.title; } var isSnippet = document.getElementById('allrecords') !== document.querySelector('.t-store__product-snippet') && document.getElementById('allrecords').contains(document.querySelector('.t-store__product-snippet')); var rec = document.getElementById('rec' + recid); for (var productKey in obj_products) { var productNode = isRelevantsShow ? rec.querySelector('.js-product-relevant[data-product-gen-uid="' + productKey + '"]') : rec.querySelector('[data-product-gen-uid="' + productKey + '"]'); // Replace #prodpopup to absolute link var prodPopups = productNode.querySelectorAll('[href^="#prodpopup"]');