Class: Impulse::PopoverComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Impulse::PopoverComponent
- Defined in:
- app/components/impulse/popover_component.rb
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(title: nil, click_boundaries: [], **system_args) ⇒ PopoverComponent
constructor
A new instance of PopoverComponent.
- #render? ⇒ Boolean
Methods inherited from ApplicationComponent
Methods included from Helpers::AttributesHelper
Constructor Details
#initialize(title: nil, click_boundaries: [], **system_args) ⇒ PopoverComponent
Returns a new instance of PopoverComponent.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/components/impulse/popover_component.rb', line 32 def initialize(title: nil, click_boundaries: [], **system_args) @title = title @system_args = system_args @system_args[:tag] = :"awc-popover" @system_args[:"click-boundaries"] = click_boundaries.to_json @panel_id = self.class.generate_id @system_args[:class] = class_names( system_args[:class], "awc-popover" ) @system_args[:data] = merge_attributes( system_args[:data], action: "keydown->awc-popover#handleKeydown" ) end |
Instance Method Details
#before_render ⇒ Object
54 55 56 |
# File 'app/components/impulse/popover_component.rb', line 54 def before_render with_header unless header? end |
#render? ⇒ Boolean
50 51 52 |
# File 'app/components/impulse/popover_component.rb', line 50 def render? trigger.present? end |