Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
401 B
2
Indexable
Never
$doc.on('click', '.js-nav .menu > .menu-item-has-children > a', (event) => {
	if(!breakpoint.matches) {
		return;
	}

	const $this = $(event.target);
	const $parent = $this.closest('.menu-item-has-children');

	if($parent.hasClass(classes.current)) {
		return;
	}

	event.preventDefault();

	$parent
		.toggleClass(classes.current)
		.siblings()
			.removeClass(classes.current);
});