Fix(SideContainerToggler.js): Check if the component exists on init
This commit is contained in:
parent
8be85de6ef
commit
cb0eef9edd
|
@ -16,17 +16,27 @@ const SideContainerToggler = {
|
|||
init(eventEmitter) {
|
||||
this.eventEmitter = eventEmitter;
|
||||
|
||||
// Adds a listener for the animation end event that would take care
|
||||
// of hiding all internal containers when the extendedToolbarPanel is
|
||||
// We may not have a side toolbar container, for example, in
|
||||
// filmstrip-only mode.
|
||||
const sideToolbarContainer
|
||||
= document.getElementById("sideToolbarContainer");
|
||||
|
||||
if (!sideToolbarContainer)
|
||||
return;
|
||||
|
||||
// Adds a listener for the animationend event that would take care of
|
||||
// hiding all internal containers when the extendedToolbarPanel is
|
||||
// closed.
|
||||
document.getElementById("sideToolbarContainer")
|
||||
.addEventListener("animationend", function(e) {
|
||||
sideToolbarContainer.addEventListener(
|
||||
"animationend",
|
||||
function(e) {
|
||||
if (e.animationName === "slideOutExt")
|
||||
$("#sideToolbarContainer").children().each(function() {
|
||||
if ($(this).hasClass("show"))
|
||||
SideContainerToggler.hideInnerContainer($(this));
|
||||
});
|
||||
}, false);
|
||||
},
|
||||
false);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue