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


109
110
111
# File 'lib/trestle/toolbar/item.rb', line 109

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

#labelObject


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

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

#optionsObject


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

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

#render_menuObject


113
114
115
# File 'lib/trestle/toolbar/item.rb', line 113

def render_menu
  [menu.render_items]
end