Class: Trestle::Toolbar::Dropdown

Inherits:
Button show all
Defined in:
lib/trestle/toolbar/item.rb

Instance Attribute Summary

Attributes inherited from Item

#menu

Instance Method Summary collapse

Methods inherited from Button

#render

Methods inherited from Item

#==, #button_classes, #button_label, #button_style, #initialize, #render, #to_s

Constructor Details

This class inherits a constructor from Trestle::Toolbar::Item

Instance Method Details

#button_style_classesObject



100
101
102
# File 'lib/trestle/toolbar/item.rb', line 100

def button_style_classes
  super + ["dropdown-toggle"]
end

#labelObject



94
95
96
97
98
# File 'lib/trestle/toolbar/item.rb', line 94

def label
  safe_join([
    super, tag.span("", class: "caret")
  ], " ")
end

#optionsObject



90
91
92
# File 'lib/trestle/toolbar/item.rb', line 90

def options
  super.merge(type: "button", data: { bs_toggle: "dropdown" })
end

#render_menuObject



104
105
106
# File 'lib/trestle/toolbar/item.rb', line 104

def render_menu
  [menu.render_items]
end