Commit a8a2a6475fa16bb10768aa589ecd70504135dfef
1 parent
b804a1e0
Exists in
master
and in
22 other branches
ActionItem716: stop annoying animation in product/enterprise browsing
Showing
1 changed file
with
1 additions
and
72 deletions
Show diff stats
app/views/search/_product_categories_menu.rhtml
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | <% end %> | 16 | <% end %> |
| 17 | <% end %> | 17 | <% end %> |
| 18 | <% product_categories_menu.each do |cat, hits, childs| %> | 18 | <% product_categories_menu.each do |cat, hits, childs| %> |
| 19 | - <li class="cat-parent" onmouseover="prodCatMenuOver(this)" onmouseout="prodCatMenuOut(this)"> | 19 | + <li class="cat-parent" > |
| 20 | <%= link_to( | 20 | <%= link_to( |
| 21 | cat.name + " " + content_tag('small', "(#{hits})"), | 21 | cat.name + " " + content_tag('small', "(#{hits})"), |
| 22 | params.merge({:product_category => cat.id}) | 22 | params.merge({:product_category => cat.id}) |
| @@ -38,76 +38,5 @@ | @@ -38,76 +38,5 @@ | ||
| 38 | </ul> | 38 | </ul> |
| 39 | </div> | 39 | </div> |
| 40 | 40 | ||
| 41 | -<script type="text/javascript"> | ||
| 42 | - | ||
| 43 | -function prodCatMenuOver( li ) { | ||
| 44 | - clearTimeout( li.timeout ); | ||
| 45 | - //if ( ! ( li.opened || li.opening ) ) { | ||
| 46 | - if ( | ||
| 47 | - ( ! li.opened ) && ( ! li.opening ) && | ||
| 48 | - ( ( ! li.e ) || li.e.state == "finished" ) | ||
| 49 | - ) { | ||
| 50 | - li.opening = true; | ||
| 51 | - li.className = "cat-parent sub-opening"; | ||
| 52 | - li.subMenu.className = "opening"; | ||
| 53 | - li.e = Effect.BlindDown(li.subMenu, { duration: 0.33 }); | ||
| 54 | - li.e._finish = li.e.finish; | ||
| 55 | - li.e.finish = function(){ | ||
| 56 | - this._finish(); | ||
| 57 | - this.element.li.closed = false; | ||
| 58 | - this.element.li.opened = true; | ||
| 59 | - this.element.li.opening = false; | ||
| 60 | - this.element.className = "opened"; | ||
| 61 | - this.element.li.className = "cat-parent sub-opened"; | ||
| 62 | - } | ||
| 63 | - li.closed = false; | ||
| 64 | - } | ||
| 65 | -} | ||
| 66 | - | ||
| 67 | -function prodCatMenuOut( li ) { | ||
| 68 | - //if ( li.e.state == "finished" ) { | ||
| 69 | - if ( | ||
| 70 | - ( ! li.closed ) && ( ! li.closeing ) && | ||
| 71 | - ( li.e.state == "finished" ) | ||
| 72 | - ) { | ||
| 73 | - li.timeout = setTimeout( function () { | ||
| 74 | - this.closeing = true; | ||
| 75 | - this.className = "cat-parent sub-closeing"; | ||
| 76 | - this.subMenu.className = "closeing"; | ||
| 77 | - this.e = Effect.BlindUp(this.subMenu, { duration: 0.5 }); | ||
| 78 | - this.e._finish = this.e.finish; | ||
| 79 | - this.e.finish = function(){ | ||
| 80 | - this._finish(); | ||
| 81 | - this.element.li.opened = false; | ||
| 82 | - this.element.li.closed = true; | ||
| 83 | - this.element.li.closeing = false; | ||
| 84 | - this.element.className = "closed"; | ||
| 85 | - this.element.li.className = "cat-parent sub-closed"; | ||
| 86 | - } | ||
| 87 | - }.bind(li), 200 ); | ||
| 88 | - } else { | ||
| 89 | - li.timeout = setTimeout( li.onmouseout.bind(li), 200 ); | ||
| 90 | - } | ||
| 91 | -} | ||
| 92 | - | ||
| 93 | -if ( document.all ) { | ||
| 94 | - | ||
| 95 | - function prodCatMenuOver( li ) { li.className = "cat-parent sub-opened" } | ||
| 96 | - function prodCatMenuOut( li ) { li.className = "cat-parent sub-closed" } | ||
| 97 | - | ||
| 98 | -} else { | ||
| 99 | - | ||
| 100 | - $$("#product-categories-menu ul div").each( function(subMenu){ | ||
| 101 | - var li = subMenu.parentNode; | ||
| 102 | - subMenu.li = li; | ||
| 103 | - li.subMenu = subMenu; | ||
| 104 | - li.subMenu.style.display = "none"; | ||
| 105 | - li.closed = true; | ||
| 106 | - }) | ||
| 107 | - | ||
| 108 | -} | ||
| 109 | - | ||
| 110 | -</script> | ||
| 111 | - | ||
| 112 | <% end %> | 41 | <% end %> |
| 113 | 42 |