module BootstrapNavbar::Helpers::Bootstrap2
Public Instance Methods
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
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_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