From 3d0372e0a0a213e25014af77cb0b4bad68cf2bb0 Mon Sep 17 00:00:00 2001 From: Pawel Suwala Date: Sun, 20 Feb 2022 16:02:10 +0100 Subject: [PATCH] Render submenu only when there are children to display Previously the submenu was rendered even when there were no children to display. This was happening when manuelement had "hidden" children. This patch renders the menu element with visible children the same way as elements without any children. --- cms_bootstrap/templates/bootstrap4/menu/ng-navbar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms_bootstrap/templates/bootstrap4/menu/ng-navbar.html b/cms_bootstrap/templates/bootstrap4/menu/ng-navbar.html index a6359dc..fe4f54d 100644 --- a/cms_bootstrap/templates/bootstrap4/menu/ng-navbar.html +++ b/cms_bootstrap/templates/bootstrap4/menu/ng-navbar.html @@ -2,7 +2,7 @@ {% spaceless %} {% with item_class=item_class|default:"nav-item" %} {% for child in children %} - {% if child.is_leaf_node %} + {% if child.is_leaf_node or child.children|length == 0%}
  • {% menu_icon child.id %}