mirror of https://github.com/ColorlibHQ/AdminLTE
changed next() to find() in Treeview toggle()
parent
a93835979a
commit
6f73dc7ca7
|
@ -87,15 +87,15 @@ const Treeview = (($) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle(event) {
|
toggle(event) {
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
const $relativeTarget = $(event.currentTarget)
|
const $relativeTarget = $(event.currentTarget)
|
||||||
const treeviewMenu = $relativeTarget.next()
|
const treeviewMenu = $relativeTarget.parents(Selector.LI).find(Selector.TREEVIEW_MENU)
|
||||||
|
|
||||||
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
|
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
const parentLi = $relativeTarget.parents(Selector.LI).first()
|
const parentLi = $relativeTarget.parents(Selector.LI).first()
|
||||||
const isOpen = parentLi.hasClass(ClassName.OPEN)
|
const isOpen = parentLi.hasClass(ClassName.OPEN)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue