mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
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
|
// nav second click
|
||||||
if (href && el.dataset.firstClick) {
|
if (href && el.dataset.firstClick) {
|
||||||
console.log(`${NAME}: nav second click`)
|
console.log(`${NAME}: nav second click`)
|
||||||
|
|
||||||
|
e.stopImmediatePropagation()
|
||||||
|
if (typeof window.app === 'undefined' || typeof window.app.Router === 'undefined') {
|
||||||
window.location.href = href
|
window.location.href = href
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
window.app.Router.openURL(href)
|
||||||
}
|
}
|
||||||
el.dataset.firstClick = true
|
el.dataset.firstClick = true
|
||||||
|
|
||||||
@ -85,7 +92,14 @@ const DropdownHoverUI = ((window) => {
|
|||||||
// big screen click
|
// big screen click
|
||||||
if (href && window.innerWidth > 768 && parent.classList.contains('active-dropdown')) {
|
if (href && window.innerWidth > 768 && parent.classList.contains('active-dropdown')) {
|
||||||
console.log(`${NAME}: big screen | nav click the dropdown is shown already`)
|
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
|
window.location.href = href
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
window.app.Router.openURL(href)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`${NAME}: nav toggle`)
|
console.log(`${NAME}: nav toggle`)
|
||||||
|
Loading…
Reference in New Issue
Block a user