Class: FoxTail::Pagination::ActionComponent
- Inherits:
-
ClickableComponent
- Object
- ClickableComponent
- FoxTail::Pagination::ActionComponent
- Defined in:
- app/components/fox_tail/pagination/action_component.rb
Instance Method Summary collapse
Instance Method Details
#before_render ⇒ Object
41 42 43 44 45 |
# File 'app/components/fox_tail/pagination/action_component.rb', line 41 def before_render super with_icon icon if !visual? && icon? end |
#call ⇒ Object
47 48 49 50 51 52 53 |
# File 'app/components/fox_tail/pagination/action_component.rb', line 47 def call super do concat visual if visual? && left? concat content_tag(:span, content || i18n_content, class: theme.apply(:label, self)) concat visual if visual? && right? end end |
#left? ⇒ Boolean
33 34 35 |
# File 'app/components/fox_tail/pagination/action_component.rb', line 33 def left? %i[first previous].include? action end |
#right? ⇒ Boolean
37 38 39 |
# File 'app/components/fox_tail/pagination/action_component.rb', line 37 def right? !left? end |