changed next() to find() in Treeview toggle()

pull/2256/head
REJack 2019-09-16 13:50:46 +02:00
parent a93835979a
commit 6f73dc7ca7
No known key found for this signature in database
GPG Key ID: 9F3976CC630CC888
1 changed files with 3 additions and 3 deletions

View File

@ -87,15 +87,15 @@ const Treeview = (($) => {
}
toggle(event) {
event.preventDefault()
const $relativeTarget = $(event.currentTarget)
const treeviewMenu = $relativeTarget.next()
const treeviewMenu = $relativeTarget.parents(Selector.LI).find(Selector.TREEVIEW_MENU)
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
return
}
event.preventDefault()
const parentLi = $relativeTarget.parents(Selector.LI).first()
const isOpen = parentLi.hasClass(ClassName.OPEN)