module BootstrapNavbar::Helpers::Bootstrap2

Public Instance Methods

navbar(options = {}, wrapper_options = {}, &block) click to toggle source
navbar_divider() click to toggle source
navbar_dropdown(name, &block) click to toggle source
navbar_dropdown_divider() click to toggle source
navbar_dropdown_header(text) click to toggle source
navbar_group(options = {}, &block) click to toggle source
navbar_item(name = nil, path = nil, list_item_options = nil, link_options = nil, &block) click to toggle source
navbar_sub_dropdown(name, list_item_options = {}, link_options = {}, &block) click to toggle source
navbar_text(text = nil, pull = nil, &block) click to toggle source

Private Instance Methods

container(brand, brand_link, responsive, fluid, &block) click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap2.rb, line 122
  def container(brand, brand_link, responsive, fluid, &block)
    css_class = fluid ? 'container-fluid' : 'container'
    content = []
    content << responsive_button if responsive
    content << navbar_brand_link(brand, brand_link) if brand || brand_link
    content << if responsive
      responsive_wrapper(&block)
    else
      capture(&block) if block_given?
    end
    prepare_html <<-HTML.chomp!
<div class="#{css_class}">
  #{content.join("\n")}
</div>
HTML
  end
dropdown_menu(&block) click to toggle source
inner_wrapper(&block) click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap2.rb, line 114
  def inner_wrapper(&block)
    prepare_html <<-HTML.chomp!
<div class="navbar-inner">
  #{capture(&block) if block_given?}
</div>
HTML
  end
responsive_button() click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap2.rb, line 150
  def responsive_button
    prepare_html <<-HTML.chomp!
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  <span class='icon-bar'></span>
  <span class='icon-bar'></span>
  <span class='icon-bar'></span>
</a>
HTML
  end
responsive_wrapper(&block) click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap2.rb, line 139
  def responsive_wrapper(&block)
    css_classes = %w(nav-collapse)
    css_classes << 'collapse' if BootstrapNavbar.configuration.bootstrap_version >= '2.2.0'
    attributes = attributes_for_tag(class: css_classes.join(' '))
    prepare_html <<-HTML.chomp!
<div#{attributes}>
  #{capture(&block) if block_given?}
</div>
HTML
  end
wrapper(options, html_options, &block) click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap2.rb, line 96
  def wrapper(options, html_options, &block)
    options, html_options = options.dup, html_options.dup
    position = case
               when options.key?(:static) then "static-#{options[:static]}"
               when options.key?(:fixed)  then "fixed-#{options[:fixed]}"
               end
    html_options[:class] = [html_options[:class], 'navbar'].compact
    html_options[:class] << "navbar-#{position}" if position
    html_options[:class] << 'navbar-inverse'     if options[:inverse]
    html_options[:class] = html_options[:class].join(' ')
    attributes = attributes_for_tag(html_options)
    prepare_html <<-HTML.chomp!
<div#{attributes}>
  #{capture(&block) if block_given?}
</div>
HTML
  end