14 lines
416 B
TypeScript
14 lines
416 B
TypeScript
export default function handleShareButton() {
|
|
const shareButton = document.querySelector('.socials-buttons__button--share');
|
|
if (!shareButton) return;
|
|
|
|
shareButton.addEventListener('click', () => {
|
|
const isOpen = shareButton.classList.contains('is-open');
|
|
if (!isOpen) {
|
|
shareButton.classList.add('is-open');
|
|
} else {
|
|
shareButton.classList.remove('is-open');
|
|
}
|
|
});
|
|
}
|