Showing
2 changed files
with
5 additions
and
1 deletions
| ... | ... | @@ -122,10 +122,14 @@ module Kanjai |
| 122 | 122 | end |
| 123 | 123 | |
| 124 | 124 | |
| 125 | + | |
| 125 | 126 | page_collection.each do |page| |
| 127 | + is_current_page = session[:url] == page.menu_url(session[:scheme], I18n.locale).gsub("/#{I18n.locale}", "") | |
| 128 | + | |
| 126 | 129 | if page.children.length > 0 and next_level |
| 127 | 130 | subparts << item[:source].to_s.gsub('###link###', page.menu_url(session[:scheme], lang = nil).to_s) |
| 128 | 131 | .gsub('###title###', page.lang_attributes(I18n.locale, :title).to_s) |
| 132 | + .gsub('###active_class###', is_current_page ? 'active' : '' ) | |
| 129 | 133 | |
| 130 | 134 | self.menu_generator(session, domain, next_level[:children], subparts, nil, false, page) |
| 131 | 135 | else | ... | ... |