mirror of https://github.com/ColorlibHQ/AdminLTE
enhanced tree collapse/expand to avoid flood slide animation on multiple clicks on one item
parent
62a29b624e
commit
ec9f780ed7
|
@ -69,7 +69,7 @@ const Treeview = (($) => {
|
||||||
this.collapse(openTreeview, openMenuLi)
|
this.collapse(openTreeview, openMenuLi)
|
||||||
}
|
}
|
||||||
|
|
||||||
treeviewMenu.slideDown(this._config.animationSpeed, () => {
|
treeviewMenu.stop().slideDown(this._config.animationSpeed, () => {
|
||||||
parentLi.addClass(ClassName.OPEN)
|
parentLi.addClass(ClassName.OPEN)
|
||||||
$(this._element).trigger(expandedEvent)
|
$(this._element).trigger(expandedEvent)
|
||||||
})
|
})
|
||||||
|
@ -78,7 +78,7 @@ const Treeview = (($) => {
|
||||||
collapse(treeviewMenu, parentLi) {
|
collapse(treeviewMenu, parentLi) {
|
||||||
const collapsedEvent = $.Event(Event.COLLAPSED)
|
const collapsedEvent = $.Event(Event.COLLAPSED)
|
||||||
|
|
||||||
treeviewMenu.slideUp(this._config.animationSpeed, () => {
|
treeviewMenu.stop().slideUp(this._config.animationSpeed, () => {
|
||||||
parentLi.removeClass(ClassName.OPEN)
|
parentLi.removeClass(ClassName.OPEN)
|
||||||
$(this._element).trigger(collapsedEvent)
|
$(this._element).trigger(collapsedEvent)
|
||||||
treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()
|
treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()
|
||||||
|
@ -159,4 +159,4 @@ const Treeview = (($) => {
|
||||||
return Treeview
|
return Treeview
|
||||||
})(jQuery)
|
})(jQuery)
|
||||||
|
|
||||||
export default Treeview
|
export default Treeview
|
||||||
|
|
Loading…
Reference in New Issue