Class: Matestack::Ui::Bootstrap::Components::Dropdown

Inherits:
VueJsComponent
  • Object
show all
Defined in:
app/concepts/matestack/ui/bootstrap/components/dropdown.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject



13
14
15
# File 'app/concepts/matestack/ui/bootstrap/components/dropdown.rb', line 13

def prepare
  @bs_menu = self.menu.is_a?(Hash) ? self.menu : { items: self.menu }
end

#responseObject



16
17
18
19
20
21
22
23
24
25
26
# File 'app/concepts/matestack/ui/bootstrap/components/dropdown.rb', line 16

def response
  div dropdown_attributes do
    split_btn_partial if slots && slots[:split_btn]
    bs_btn btn_attributes unless slots && slots[:split_btn]

    ul menu_attributes do
      menu_partial unless @bs_menu[:items].blank?
      yield_components
    end
  end
end