Changed the menu click point to the arrow
This commit is contained in:
parent
3f130712b4
commit
5bc71cc7f6
2
themes/daux/css/theme-blue.min.css
vendored
2
themes/daux/css/theme-blue.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-green.min.css
vendored
2
themes/daux/css/theme-green.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-navy.min.css
vendored
2
themes/daux/css/theme-navy.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-red.min.css
vendored
2
themes/daux/css/theme-red.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -107,15 +107,16 @@ if (hljs) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var navItems = document.querySelectorAll('.Nav__item.has-children > a');
|
var navItems = document.querySelectorAll('.Nav__item.has-children i.Nav__arrow');
|
||||||
|
|
||||||
function _toggleSubMenu(ev) {
|
function _toggleSubMenu(ev) {
|
||||||
if (ev.preventDefault !== undefined) {
|
if (ev.preventDefault !== undefined) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = ev.target.parentNode;
|
var parent = ev.target.parentNode.parentNode;
|
||||||
var subNav = parent.querySelector('ul.Nav');
|
var subNav = parent.querySelector('ul.Nav');
|
||||||
|
console.log(parent);
|
||||||
|
|
||||||
if (ev.preventDefault !== undefined && parent.classList.contains('Nav__item--open')) {
|
if (ev.preventDefault !== undefined && parent.classList.contains('Nav__item--open')) {
|
||||||
subNav.style.height = 0;
|
subNav.style.height = 0;
|
||||||
@ -156,7 +157,7 @@ if (hljs) {
|
|||||||
cur = navItems[i];
|
cur = navItems[i];
|
||||||
cur.addEventListener('click', _toggleSubMenu);
|
cur.addEventListener('click', _toggleSubMenu);
|
||||||
|
|
||||||
if (cur.parentNode.classList.contains('Nav__item--open')) {
|
if (cur.parentNode.parentNode.classList.contains('Nav__item--open')) {
|
||||||
_toggleSubMenu({ target: cur });
|
_toggleSubMenu({ target: cur });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,11 +159,6 @@ Components
|
|||||||
width: 16px;
|
width: 16px;
|
||||||
margin-left: -16px;
|
margin-left: -16px;
|
||||||
|
|
||||||
// Prevent arrow from being the target in its container's event listener.
|
|
||||||
&, &::before {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: block;
|
display: block;
|
||||||
|
Loading…
Reference in New Issue
Block a user