Files
5chan/src/utils/handleQuoteClick.js
T

12 lines
365 B
JavaScript
Raw Normal View History

2023-04-13 17:08:35 +02:00
function handleQuoteClick(reply) {
const cid = reply.shortCid;
const targetElement = [...document.querySelectorAll('.post-reply')]
.find(el => el.innerHTML.includes(cid));
if (targetElement) {
targetElement.scrollIntoView({ behavior: "instant" });
} else {
console.log('Could not find target element');
}
};
export default handleQuoteClick;