Module: Card::Set::All::Bootstrap::Dropdown::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod026-bootstrap/all/bootstrap/dropdown.rb

Instance Method Summary collapse

Instance Method Details



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/dropdown.rb', line 9

def dropdown_button name, items_or_opts={}, opts={}
  items = block_given? ? yield : items_or_opts
  opts = items_or_opts if block_given?
  "    <div class=\"btn-group \#{opts[:extra_css_class]}\" role=\"group\">\n      <button class=\"btn btn-primary dropdown-toggle\"\n              data-toggle=\"dropdown\" title=\"\#{name}\" aria-expanded=\"false\"\n              aria-haspopup=\"true\">\n        \#{icon_tag opts[:icon] if opts[:icon]} \#{name}\n        <span class=\"caret\"></span>\n      </button>\n      \#{dropdown_list items, opts[:class], opts[:active]}\n    </div>\n  HTML\nend\n"

#split_button(main_button, active_item) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/dropdown.rb', line 25

def split_button main_button, active_item
  wrap_with :div, class: "btn-group" do
    [
      main_button,
      split_button_toggle,
      dropdown_list(yield, nil, active_item)
    ]
  end
end