41014102var feedLinks = document.querySelectorAll('.t-feed__link');4103if (!feedLinks) return;41044105/* check if event focus from mouse or from keyboard */4106var handlerType = null;4107document.addEventListener('keydown', function () {4108handlerType = 'keyboard';4109});4110document.addEventListener('mousedown', function () {4111handlerType = 'mouse';4112
}); Array.prototype.forEach.call(feedLinks, function (link) { var post = link.closest('.t-feed__post'); link.addEventListener('focus', function () { if (handlerType === 'keyboard') { if (post) { post.classList.add('t-focusable'); } handlerType = null; } else { return; } }); link.addEventListener('blur', function () { if (post) { post.classList.remove('t-focusable'); } }); });}function t_feed_onFuncLoad(funcName, okFunc, time) { if (typeof window[funcName] === 'function') { okFunc(); } else { setTimeout(function checkFuncExist() { if (typeof window[funcName] === 'function') { okFunc(); return; } if (document.readyState === 'complete' && typeof window[funcName] !== 'function') { throw new Error(funcName + ' is undefined'); } setTimeout(checkFuncExist, time || 100); }); }}function t_feed__trapFocus(popup) { var focusableEls = popup.querySelectorAll('a, button, input:not([type="hidden"]), select, textarea, video, iframe'); var firstFocusableElement = focusableEls[0]; var lastFocusableElement = focusableEls[focusableEls.length - 1]; document.addEventListener('keydown', function (event) { var isTabPressed = event.key === 'Tab' || event.keyCode === 9; if (!isTabPressed) { return; } if (event.shiftKey) { // if tab+shift and we moving back if (document.activeElement === firstFocusableElement) { lastFocusableElement.focus(); event.preventDefault(); } } else if (document.activeElement === lastFocusableElement) { firstFocusableElement.focus(); event.preventDefault(); } });}function t_feed__getRootZone() { const allrecords = document.getElementById('allrecords'); const rootZone = allrecords && allrecords.getAttribute('data-tilda-root-zone'); return rootZone || 'com';}// Polyfill: Element.matchesif (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.msMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.oMatchesSelector;}// Polyfill: Element.closestif (!Element.prototype.closest) { Element.prototype.closest = function (s) { var el = this; while (el && el.nodeType === 1) { if (Element.prototype.matches.call(el, s)) { return el; }