2001// запоминаем текущее состояние истории2002var popupState = window.history.state;20032004// скроллим попап к якорю2005t_feed_scrollTo(popup, elementToScroll.offsetTop, 300);20062007// проставляем новое состояние в историю2008window.history.pushState(popupState, null, window.location.origin + window.location.pathname + anchor);2009});2010});2011}2012
function t_feed_addPostPopupGallery(recid, post) { if (post.mediadata !== '' && JSON.parse(post.mediadata).length > 0) { t_feed_setGalleryImageHeight(recid); t_feed_onFuncLoad('t_sldsInit', function () { t_sldsInit(recid + ' .t-feed__post-popup'); if ( window.lazy === 'y' || document.querySelector('#allrecords').getAttribute('data-tilda-lazy') === 'yes' ) { t_feed_onFuncLoad('t_lazyload_update', function () { t_lazyload_update(); }); } t_feed_onFuncLoad('t_slds_updateSlider', function () { t_slds_updateSlider(recid + ' .t-feed__post-popup'); }); t_feed_onFuncLoad('t_slds_UpdateSliderHeight', function () { t_slds_UpdateSliderHeight(recid + ' .t-feed__post-popup'); }); t_feed_onFuncLoad('t_slds_UpdateSliderArrowsHeight', function () { t_slds_UpdateSliderArrowsHeight(recid + ' .t-feed__post-popup'); }); }); }}/** * Add skeleton for popup elements on slow load */function t_feed_addPostPopupLoader() { var loader = ''; for (var i = 0; i < 20; i++) { loader += '<div class="t-feed__post-popup__text-loader"></div>'; } document.querySelector('.js-feed-post-text').innerHTML = loader;}/** * Add zoom for images in popup if zoom setting is on */function t_feed_addZoom() { var images = document.querySelectorAll('.js-feed-post-text img'); Array.prototype.forEach.call(images, function (image) { image.classList.add('t-zoomable'); image.setAttribute('data-zoomable', 'yes'); image.setAttribute('data-img-zoom-url', image.getAttribute('src')); });}function t_feed_showPopup(recid, post, opts) { var rec = document.querySelector('#rec' + recid); var popup = rec.querySelector('.t-feed__post-popup.t-popup'); var arrowTop = popup.querySelector('.t-feed__post-popup__arrow-top'); var currentUrl = window.location.href; popup.style.display = 'block'; popup.classList.add('t-popup_show'); setTimeout(function () { popup.querySelector('.t-popup__container').classList.remove('t-feed__post-popup__container_loading'); popup.focus(); t_feed__trapFocus(popup); // a11y: add class to the trigger button for focus t_feed__addClassOnTriggerButton(); }, 300); setTimeout(function () { popup.querySelector('.t-popup__container').classList.add('t-popup__container-animated'); if (window.lazy === 'y' || document.querySelector('#allrecords').getAttribute('data-tilda-lazy') === 'yes') { t_feed_onFuncLoad('t_lazyload_update', function () { t_lazyload_update(); }); } }, 50); setTimeout(() => { ttable.init_ttable(); }, 400); document.body.classList.add('t-body_popupshowed'); t_feed_getCountOfViews(popup); if (arrowTop) { popup.addEventListener('scroll', function () { t_feed_addPostPopupArrowTop(this, arrowTop);