enhanced tree collapse/expand to avoid flood slide animation on multiple clicks on one item

pull/2197/head
REJack 5 years ago
parent 62a29b624e
commit ec9f780ed7
No known key found for this signature in database
GPG Key ID: 9F3976CC630CC888

@ -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()

Loading…
Cancel
Save