From 68834fc6489b9df84f14a0ed1621a69511d62714 Mon Sep 17 00:00:00 2001 From: Daniel Vilanova Yamuza Date: Sun, 24 Feb 2019 15:16:53 +0100 Subject: [PATCH 1/2] Now the collapse and expand event are triggered after the event loop, Fixes #2019 --- dist/js/adminlte.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/js/adminlte.js b/dist/js/adminlte.js index 329012937..25505dd8f 100644 --- a/dist/js/adminlte.js +++ b/dist/js/adminlte.js @@ -1077,7 +1077,7 @@ throw new Error('AdminLTE requires jQuery') parent.addClass(ClassName.open); tree.slideDown(this.options.animationSpeed, function () { - $(this.element).trigger(expandedEvent); + setTimeout(() => $(this.element).trigger(expandedEvent),0) }.bind(this)); }; @@ -1086,9 +1086,9 @@ throw new Error('AdminLTE requires jQuery') //tree.find(Selector.open).removeClass(ClassName.open); parentLi.removeClass(ClassName.open); - tree.slideUp(this.options.animationSpeed, function () { + tree.slideUp(this.options.animationSpeed, function () { //tree.find(Selector.open + ' > ' + Selector.treeview).slideUp(); - $(this.element).trigger(collapsedEvent); + setTimeout(() => $(this.element).trigger(collapsedEvent), 0); }.bind(this)); }; From f8fe281c43e35657923fdc7a1d0266f3edc97aea Mon Sep 17 00:00:00 2001 From: Daniel Vilanova Yamuza Date: Sun, 24 Feb 2019 15:23:09 +0100 Subject: [PATCH 2/2] Fixed formatting --- dist/js/adminlte.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/js/adminlte.js b/dist/js/adminlte.js index 25505dd8f..bf6d10669 100644 --- a/dist/js/adminlte.js +++ b/dist/js/adminlte.js @@ -1086,7 +1086,7 @@ throw new Error('AdminLTE requires jQuery') //tree.find(Selector.open).removeClass(ClassName.open); parentLi.removeClass(ClassName.open); - tree.slideUp(this.options.animationSpeed, function () { + tree.slideUp(this.options.animationSpeed, function () { //tree.find(Selector.open + ' > ' + Selector.treeview).slideUp(); setTimeout(() => $(this.element).trigger(collapsedEvent), 0); }.bind(this));