Commit 82a27e5a6129fdfeed4c18b12c349ad03cec4122

Authored by Braulio Bhavamitra
1 parent a45a9dc5

Remove elipse on navigation

Showing 1 changed file with 2 additions and 19 deletions   Show diff stats
app/helpers/manage_products_helper.rb
@@ -26,27 +26,10 @@ module ManageProductsHelper @@ -26,27 +26,10 @@ module ManageProductsHelper
26 def hierarchy_category_navigation(current_category, options = {}) 26 def hierarchy_category_navigation(current_category, options = {})
27 hierarchy = [] 27 hierarchy = []
28 if current_category 28 if current_category
29 - count_chars = 0  
30 - unless options[:hide_current_category]  
31 - hierarchy << current_category.name  
32 - count_chars += current_category.name.length  
33 - end 29 + hierarchy << current_category.name unless options[:hide_current_category]
34 ancestors = current_category.ancestors 30 ancestors = current_category.ancestors
35 - toplevel = ancestors.pop  
36 - if toplevel  
37 - count_chars += toplevel.name.length  
38 - end  
39 ancestors.each do |category| 31 ancestors.each do |category|
40 - if count_chars > 55  
41 - hierarchy << hierarchy_category_item(category, options[:make_links], '( … )')  
42 - break  
43 - else  
44 - hierarchy << hierarchy_category_item(category, options[:make_links])  
45 - end  
46 - count_chars += category.name.length  
47 - end  
48 - if toplevel  
49 - hierarchy << hierarchy_category_item(toplevel, options[:make_links]) 32 + hierarchy << hierarchy_category_item(category, options[:make_links])
50 end 33 end
51 end 34 end
52 hierarchy.reverse.join(options[:separator] || ' &rarr; ') 35 hierarchy.reverse.join(options[:separator] || ' &rarr; ')