t_onReady(function () {
var hash = window.location.hash;
t_onFuncLoad('t270_scroll', function () {
t270_scroll(hash, -3);
});
setTimeout(function() {
var curPath = window.location.pathname;
var curFullPath = window.location.origin + curPath;
var recs = document.querySelectorAll('.r');
Array.prototype.forEach.call(recs, function(rec) {
var selects = 'a[href^="#"]:not([href="#"]):not(.carousel-control):not(.t-carousel__control):not([href^="#price"]):not([href^="#submenu"]):not([href^="#popup"]):not([href^="#prodpopup"]):not([href^="#order"]):not([href^="#!"]):not([target="_blank"]),' +
'a[href^="' + curPath + '#"]:not([href*="#!/tproduct/"]):not([href*="#!/tab/"]):not([href*="#popup"]):not([target="_blank"]),' +
'a[href^="' + curFullPath + '#"]:not([href*="#!/tproduct/"]):not([href*="#!/tab/"]):not([href*="#popup"]):not([target="_blank"])';
var elements = rec.querySelectorAll(selects);
Array.prototype.forEach.call(elements, function(element) {
element.addEventListener('click', function (event) {
event.preventDefault();
var hash = this.hash.trim();
t_onFuncLoad('t270_scroll', function () {
t270_scroll(hash, -3);
});
});
});
});
if (document.querySelectorAll('.js-store').length > 0 || document.querySelectorAll('.js-feed').length > 0) {
t_onFuncLoad('t270_scroll', function () {
t270_scroll(hash, -3, 1);
});
}
}, 500);
setTimeout(function() {
var hash = window.location.hash;
var isMobile = window.innerWidth < 768;
if (hash && document.querySelectorAll('a[name="' + hash.slice(1) + '"]').length > 0) {
t_onFuncLoad('t270_scroll', function () {
t270_scroll(hash, isMobile ? 0 : -3);
});
}
}, 1000);
window.addEventListener('popstate', function() {
var hash = window.location.hash;
var isMobile = window.innerWidth < 768;
if (hash && document.querySelectorAll('a[name="' + hash.slice(1) + '"]').length > 0) {
t_onFuncLoad('t270_scroll', function () {
t270_scroll(hash, isMobile ? 0 : -3);
});
}
});
});