Class: FoxTail::CarouselComponent::StimulusController

Inherits:
StimulusController show all
Defined in:
app/components/fox_tail/carousel_component.rb

Instance Attribute Summary

Attributes inherited from StimulusController

#identifier

Instance Method Summary collapse

Methods inherited from StimulusController

#action, #action_param_key, #build_actions, #classes_key, #config, #event, #initialize, #merge, #merge!, #outlet_key, #target_key, #to_s, #to_sym, #value_key

Constructor Details

This class inherits a constructor from FoxTail::StimulusController

Instance Method Details

#attributes(options = {}) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
# File 'app/components/fox_tail/carousel_component.rb', line 76

def attributes(options = {})
  attributes = super
  attributes[:data][value_key(:position)] = options[:position]
  attributes[:data][value_key(:interval)] = options[:interval]
  attributes[:data][classes_key(:previous_slide)] = options[:previous_slide_classes]
  attributes[:data][classes_key(:current_slide)] = options[:current_slide_classes]
  attributes[:data][classes_key(:next_slide)] = options[:next_slide_classes]
  attributes[:data][classes_key(:hidden_slide)] = options[:hidden_slide_classes]
  attributes[:data][classes_key(:active_indicator)] = options[:active_indicator_classes]
  attributes[:data][classes_key(:inactive_indicator)] = options[:inactive_indicator_classes]
  attributes
end