<commit_before><% if @product_category %>
  <h3 class="current-cat-path">
    <%= @product_category.hierarchy.map {|cat| ((cat == @product_category) ? content_tag('span', cat.name) : link_to((cat.name), params.merge({:product_category => cat.id}))) }.join(' &rarr; ') %>
  </h3>
<% end %>

<% if product_categories_menu %>

<div id="product-categories-menu">
  <ul>
    <% if product_categories_menu.empty? %>
      <% if @product_category %>
        <li class="cat-empty"> <%= _('There is no sub-categories for %s.') % @product_category.name %> </li>
      <% else %>
        <li class="cat-empty"> <%= _('There is no categories.') %> </li>
      <% end %>
    <% end %>
    <% product_categories_menu.each do |cat, hits, childs| %>
      <li class="cat-parent" onmouseover="prodCatMenuOver(this)" onmouseout="prodCatMenuOut(this)">
        <%= link_to(
              cat.name + " " + content_tag('small', "(#{hits})"),
              params.merge({:product_category => cat.id})
         ) %>
        <% if !childs.blank? %>
          <div>
            <ul>
              <% childs.each do |child, child_hits| %>
                <li class="cat-child"> <%= link_to(
                           child.name + " " + content_tag('small', "(#{child_hits})"),
                           params.merge({:product_category => child.id})
                      ) %> </li>
              <% end %>
            </ul>
          </div>
        <% end %>
      </li>
    <% end %>
  </ul>
</div>

<script type="text/javascript">

function prodCatMenuOver( li ) {
  clearTimeout( li.timeout );
  //if ( ! ( li.opened || li.opening ) ) {
  if (
       ( ! li.opened ) && ( ! li.opening ) &&
       ( ( ! li.e ) || li.e.state == "finished" )
     ) {
    li.opening = true;
    li.className = "cat-parent sub-opening";
    li.subMenu.className = "opening";
    li.e = Effect.BlindDown(li.subMenu, { duration: 0.33 });
    li.e._finish = li.e.finish;
    li.e.finish = function(){
        this._finish();
        this.element.li.closed = false;
        this.element.li.opened = true;
        this.element.li.opening = false;
        this.element.className = "opened";
        this.element.li.className = "cat-parent sub-opened";
      }
    li.closed = false;
  }
}

function prodCatMenuOut( li ) {
  //if ( li.e.state == "finished" ) {
  if (
       ( ! li.closed ) && ( ! li.closeing ) &&
       ( li.e.state == "finished" )
     ) {
    li.timeout = setTimeout( function () {
        this.closeing = true;
        this.className = "cat-parent sub-closeing";
        this.subMenu.className = "closeing";
        this.e = Effect.BlindUp(this.subMenu, { duration: 0.5 });
        this.e._finish = this.e.finish;
        this.e.finish = function(){
            this._finish();
            this.element.li.opened = false;
            this.element.li.closed = true;
            this.element.li.closeing = false;
            this.element.className = "closed";
            this.element.li.className = "cat-parent sub-closed";
          }
      }.bind(li), 200 );
  } else {
    li.timeout = setTimeout( li.onmouseout.bind(li), 200 );
  }
}

if ( document.all ) {

  function prodCatMenuOver( li ) { li.className = "cat-parent sub-opened" }
  function prodCatMenuOut( li )  { li.className = "cat-parent sub-closed" }

} else {

  $$("#product-categories-menu ul div").each( function(subMenu){
    var li = subMenu.parentNode;
    subMenu.li = li;
    li.subMenu = subMenu;
    li.subMenu.style.display = "none";
    li.closed = true;
  })

}

</script>

<% end %>
<commit_msg>ActionItem716: stop annoying animation in product/enterprise browsing<commit_after><% if @product_category %>
  <h3 class="current-cat-path">
    <%= @product_category.hierarchy.map {|cat| ((cat == @product_category) ? content_tag('span', cat.name) : link_to((cat.name), params.merge({:product_category => cat.id}))) }.join(' &rarr; ') %>
  </h3>
<% end %>

<% if product_categories_menu %>

<div id="product-categories-menu">
  <ul>
    <% if product_categories_menu.empty? %>
      <% if @product_category %>
        <li class="cat-empty"> <%= _('There is no sub-categories for %s.') % @product_category.name %> </li>
      <% else %>
        <li class="cat-empty"> <%= _('There is no categories.') %> </li>
      <% end %>
    <% end %>
    <% product_categories_menu.each do |cat, hits, childs| %>
      <li class="cat-parent" >
        <%= link_to(
              cat.name + " " + content_tag('small', "(#{hits})"),
              params.merge({:product_category => cat.id})
         ) %>
        <% if !childs.blank? %>
          <div>
            <ul>
              <% childs.each do |child, child_hits| %>
                <li class="cat-child"> <%= link_to(
                           child.name + " " + content_tag('small', "(#{child_hits})"),
                           params.merge({:product_category => child.id})
                      ) %> </li>
              <% end %>
            </ul>
          </div>
        <% end %>
      </li>
    <% end %>
  </ul>
</div>

<% end %>

{'fraction_non_alphanumeric': 0.1856120826709062, 'fraction_numerical': 0.003577106518282989, 'mean_word_length': 2.074526572999389, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5099613', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1627, 'n_words': 304}