class Interview::Dropdown

Attributes

caption[RW]
container_tag[RW]
image[RW]
style[RW]

Public Instance Methods

build(b) { || ... } click to toggle source
# File lib/interview/controls/dropdown.rb, line 8
def build(b)
  container_tag = @container_tag || 'div'
  html_class = @html_class.dup
  html_class << 'dropdown'
  b.section style: container_tag, html_class: html_class, html_options: @html_options do
    html_class = %w(dropdown-toggle)
    html_class += %w(btn btn-default) if @style == 'button'
    b.link image: @image, caption: @caption, url: '#', html_class: html_class, 
           html_options: { data: { toggle: 'dropdown' } } do
      b.space if @image or @caption
      b.glyphicon image: 'caret'
    end
    b.section style: 'ul', html_class: 'dropdown-menu' do
      b.meta_control pointer: self do
        yield if block_given?
      end
    end
  end
end
build_child(b, control, &block) click to toggle source
Calls superclass method Interview::Control#build_child
# File lib/interview/controls/dropdown.rb, line 28
def build_child(b, control, &block)
  b.section style: 'li' do
    super
  end
end