Skip to content

Commit

Permalink
Add *skip_caret* option to RenderedItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Rodriguez committed Jun 24, 2016
1 parent 9be185b commit d530905
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/simple_navigation_bootstrap/rendered_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def initialize(renderer, item, level, bootstrap_version)
@divider = options.delete(:divider) { false }
@header = options.delete(:header) { false }
@split = options.delete(:split) { false }
@skip_caret = options.delete(:skip_caret) { false }
@link_options = @item.link_html_options || {}
end

Expand All @@ -36,7 +37,7 @@ def to_s
private


attr_reader :item, :level, :bootstrap_version, :options, :navbar_text, :divider, :header, :link_options, :split
attr_reader :item, :level, :bootstrap_version, :options, :navbar_text, :divider, :header, :split, :skip_caret, :link_options

def li_text
content_tag(:li, content_tag(:p, item.name, class: 'navbar-text'), options)
Expand All @@ -63,7 +64,10 @@ def li_link
if split
splitted_simple_part + splitted_dropdown_part
else
dropdown_part("#{item.name} #{caret}".html_safe)
content = [item.name]
content << caret unless skip_caret
content = content.join(' ').html_safe
dropdown_part(content)
end
else
content_tag(:li, dropdown_submenu_link, options)
Expand Down

0 comments on commit d530905

Please sign in to comment.