4701' data-original="' +4702url +4703'"></div>';4704} else {4705str += '<div class="t-product__option-checkmark ' + checkmarkMod + '"' + checkmarkStyle + '></div>';4706}47074708str +=4709'<span class="t-product__option-title ' +4710titleMod +4711' t-typography__options t-descr t-descr_xxs">' +4712value +
'</span>'; str += '</label>'; } str += '</form>'; wrapper.insertAdjacentHTML('beforeend', str);}/** * Returns the color value for a given option value. * * @param {Object} valuesObj - An object containing option values and their corresponding colors. * @param {string} value - The option value to get the color for. * @return {string} - The color value for the given option value. */function t_store_option_getColorValue(valuesObj, value) { var result = '#ffffff'; for (var key in valuesObj) { var item = valuesObj[key]; if (item.value === value.toString()) { result = item.color; break; } } return result;}function t_store_option_getClassModificator(curOption, type, className) { // Add class modificators for both filters and options if (!curOption) { return ''; } var params = curOption.params; var result = className + '_' + params.view; if (params.hasColor && params.linkImage) { // If product options has both color and image, design for filters and options differ if (type === 'filter') { result = className + '_buttons'; result += ' ' + className + '_color'; } else { result += ' ' + className + '_image'; } } else if (params.hasColor) { result += ' ' + className + '_color'; } else if (params.linkImage) { result += ' ' + className + '_image'; } else { result += ' ' + className + '_simple'; } return result;}function t_store_checkUrl(options, recid) { var curUrl = window.location.href; var tprodIndex = curUrl.indexOf('/tproduct/'); if (/iPhone|iPad|iPod/i.test(navigator.userAgent) && tprodIndex < 0) { tprodIndex = curUrl.indexOf('/tproduct/'); if (tprodIndex < 0) { tprodIndex = curUrl.indexOf('%2Ftproduct%2F'); } } if (tprodIndex >= 0) { curUrl = curUrl.substring(tprodIndex, curUrl.length); var prodDataArr = curUrl.split('-'); if (typeof prodDataArr[1] === 'undefined') { return; } var curProdUid = prodDataArr[1]; var rec = document.getElementById('rec' + recid); var prod = rec.querySelector('.js-store-grid-cont [data-product-gen-uid="' + curProdUid + '"]'); var el_popup = rec.querySelector('.t-popup'); if (curUrl.indexOf(recid) >= 0 && prod) { // if product exists among products list at slice 1, we trigger click if (!el_popup.classList.contains('t-popup_show')) { var prodPopupBtn = prod.querySelector('[href^="#prodpopup"]'); if (prodPopupBtn) { prodPopupBtn.click(); } } // scroll to product // work incorrect, need fix // var prodOffset = prod.offset().top; // $(window).scrollTop(prodOffset - 100);