IMPR: Stop bubling on second click
This commit is contained in:
parent
fe5ede2003
commit
03c6ca6332
|
@ -77,7 +77,14 @@ const DropdownHoverUI = ((window) => {
|
|||
// nav second click
|
||||
if (href && el.dataset.firstClick) {
|
||||
console.log(`${NAME}: nav second click`)
|
||||
|
||||
e.stopImmediatePropagation()
|
||||
if (typeof window.app === 'undefined' || typeof window.app.Router === 'undefined') {
|
||||
window.location.href = href
|
||||
return
|
||||
}
|
||||
|
||||
window.app.Router.openURL(href)
|
||||
}
|
||||
el.dataset.firstClick = true
|
||||
|
||||
|
@ -85,7 +92,14 @@ const DropdownHoverUI = ((window) => {
|
|||
// big screen click
|
||||
if (href && window.innerWidth > 768 && parent.classList.contains('active-dropdown')) {
|
||||
console.log(`${NAME}: big screen | nav click the dropdown is shown already`)
|
||||
|
||||
e.stopImmediatePropagation()
|
||||
if (typeof window.app === 'undefined' || typeof window.app.Router === 'undefined') {
|
||||
window.location.href = href
|
||||
return
|
||||
}
|
||||
|
||||
window.app.Router.openURL(href)
|
||||
}
|
||||
|
||||
console.log(`${NAME}: nav toggle`)
|
||||
|
|
Loading…
Reference in New Issue