Class: Irelia::Dropdown::Component::CustomDropdownTrigger

Inherits:
Component
  • Object
show all
Defined in:
app/components/irelia/dropdown/component.rb

Instance Method Summary collapse

Methods inherited from Component

#add_css_classes, after_initialize, #html_options, inherited, run_after_initialize_hooks, #variants

Constructor Details

#initialize(**options) ⇒ CustomDropdownTrigger

Returns a new instance of CustomDropdownTrigger.



33
34
35
36
37
38
# File 'app/components/irelia/dropdown/component.rb', line 33

def initialize(**options)
  options[:html_options] ||= {}
  options[:html_options]["data"] = { "action": "irelia-dropdown#toggle click@window->irelia-dropdown#hide" }
  options[:html_options]["style"] = "display:block;width:100%"
  super(**options)
end

Instance Method Details

#callObject



40
41
42
# File 'app/components/irelia/dropdown/component.rb', line 40

def call
  (:button, content, html_options)
end