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
- #dropdown_button(name, items_or_opts = {}, opts = {}) ⇒ Object
- #split_button(main_button, active_item) ⇒ Object
Instance Method Details
#dropdown_button(name, items_or_opts = {}, opts = {}) ⇒ Object
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 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 , active_item wrap_with :div, class: "btn-group" do [ , , dropdown_list(yield, nil, active_item) ] end end |