Преглед изворни кода

Hide actions if _actions is empty

Added a replace function to check if the list is empty.

Now _actions included a string like '<li></li>' so this was never empty.
NoScopie пре 11 година
родитељ
комит
1abd7b2926
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      Resources/views/standard_layout.html.twig

+ 1 - 1
Resources/views/standard_layout.html.twig

@@ -245,7 +245,7 @@ file that was distributed with this source code.
                                                     {% endif %}
                                                 </div>
 
-                                                {% if _actions is not empty %}
+                                                {% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
                                                     <ul class="nav navbar-nav navbar-right">
                                                         <li class="dropdown sonata-actions">
                                                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <b class="caret"></b></a>