leaflet: Hide children on transition end only when folded

Hides the last visible child at the end of an animation only if the
leaflet is folded. This avoids children to become incorrectly invisible
at the end of the transition when the leaflet is unfolded.

1 job for leaflet-unfolded-invisible-child in 2 minutes and 8 seconds (queued for 2 seconds)