Class: FoxTail::DrawerTriggerComponent

Inherits:
TriggerBaseComponent show all
Defined in:
app/components/fox_tail/drawer_trigger_component.rb

Defined Under Namespace

Classes: StimulusController

Instance Attribute Summary

Attributes inherited from TriggerBaseComponent

#block, #selector

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from TriggerBaseComponent

#block?, #call, #initialize, #render?

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::TriggerBaseComponent

Instance Method Details

#before_renderObject



6
7
8
9
10
11
12
# File 'app/components/fox_tail/drawer_trigger_component.rb', line 6

def before_render
  super

  html_attributes[:class] = classnames theme.apply(:root, self),
    theme.apply("root/#{open? ? :open : :close}", self),
    html_class
end

#stimulus_controller_optionsObject



14
15
16
17
# File 'app/components/fox_tail/drawer_trigger_component.rb', line 14

def stimulus_controller_options
  super.merge open_classes: theme.apply("root/open", self),
    closed_classes: theme.apply("root/closed", self)
end