<%
  if !!local_assigns[:apply_css] and (classes = menu_branch_css(local_assigns)).any?
    css = "class='#{classes.join(' ')}'".html_safe
  end
  dom_id = "id='item_#{menu_branch_counter}'".html_safe if menu_branch.parent_id.nil?

  children = menu_branch.children unless hide_children
-%>
<li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '').html_safe %>>
  <%= link_to menu_branch.title, menu_branch.url -%>
  <% if children.present? -%>
    <ul class='clearfix'>
      <%= render :partial => '/shared/menu_branch', :collection => children,
                 :locals => {
                   :apply_css => local_assigns[:apply_css],
                   :hide_children => !!hide_children
                 } -%>
    </ul>
  <% end -%>
</li>

<%
  if !!local_assigns[:apply_css] and (classes = menu_branch_css(local_assigns)).any?
    css = "class='#{classes.join(' ')}'".html_safe
  end
  # dom_id DEPRECATED: REMOVE AT 1.1, serves no purpose same with css attributes 'first' and 'last'
  dom_id = "id='item_#{menu_branch_counter}'".html_safe if menu_branch.parent_id.nil?
-%>
<li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '').html_safe %>>
  <%= link_to menu_branch.title, menu_branch.url -%>
  <% if (children = menu_branch.children unless hide_children).present? -%>
    <ul class='clearfix'>
      <%= render :partial => '/shared/menu_branch', :collection => children,
                 :locals => {
                   :apply_css => local_assigns[:apply_css],
                   :hide_children => !!hide_children
                 } -%>
    </ul>
  <% end -%>
</li>

Move children inline and mark dom_id for destruction (deprecated).
Move children inline and mark dom_id for destruction (deprecated).
