From 91340a5268129f1104acbb1b491635e77459f509 Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 7 Nov 2016 14:30:02 -0600 Subject: [PATCH] Hides all side panels before showing new one. --- modules/UI/side_pannels/SideContainerToggler.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/UI/side_pannels/SideContainerToggler.js b/modules/UI/side_pannels/SideContainerToggler.js index d63e8c837..763d07d41 100644 --- a/modules/UI/side_pannels/SideContainerToggler.js +++ b/modules/UI/side_pannels/SideContainerToggler.js @@ -109,6 +109,16 @@ const SideContainerToggler = { * element to show */ showInnerContainer(containerSelector) { + + // Before showing the container, make sure there is no other visible. + // If we quickly show a container, while another one is animating + // and animation never ends, so we do not really hide the first one and + // we end up with to shown panels + $("#sideToolbarContainer").children().each(function() { + if ($(this).hasClass("show")) + SideContainerToggler.hideInnerContainer($(this)); + }); + containerSelector.removeClass("hide").addClass("show"); this.eventEmitter.emit(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,