1. Shlomi Fish
  2. perl-HTML-Widgets-NavMenu

Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed c15f964

Extract Method for get_open_sub_menu_tags.

  • Participants
  • Parent commits a1f12c6
  • Branches default

Comments (0)

Files changed (1)

File module/lib/HTML/Widgets/NavMenu/Iterator/NavMenu.pm

View file
  • Ignore whitespace
     return $self->start_handle_non_role();
 }
 
+sub get_open_sub_menu_tags
+{
+    my $self = shift;
+    return ("<br />", $self->gen_ul_tag('depth' => $self->stack->len()));
+}
+
 sub start_handle_non_role
 {
     my $self = shift;
     my @tags_to_add = ("<li>", $self->get_link_tag());
     if ($top_item->num_subs_to_go() && $self->is_expanded())
     {
-        push @tags_to_add,
-            ("<br />", $self->gen_ul_tag('depth' => $self->stack->len()));
+        push @tags_to_add, ($self->get_open_sub_menu_tags());
     }
     $self->_add_tags(@tags_to_add);
 }