Files
szkoleniauryzaj.pl/wp-content/plugins/youtube-feed-pro/js/divi-preview-handler.js
2026-04-26 23:47:49 +02:00

26 lines
702 B
JavaScript

function docReady(fn) {
// see if DOM is already available
if (
document.readyState === "complete" ||
document.readyState === "interactive"
) {
// call on next available tick
setTimeout(fn, 1);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
docReady(function () {
document.body.addEventListener("click", function (event) {
// Check if the clicked element has the specific class
if (
event.target &&
( event.target.classList.contains("sby-feed-block-link") || event.target.classList.contains("sby-feed-block-cta-btn") )
) {
const href = event.target.getAttribute("href");
window.open(href, "_blank");
}
});
});