Class: TurboOverlay::PopoverConfig
- Inherits:
-
OverlayTypeConfig
- Object
- OverlayTypeConfig
- TurboOverlay::PopoverConfig
- Defined in:
- lib/turbo_overlay/configuration.rb
Overview
Popover config extends OverlayTypeConfig with anchored-positioning defaults. Popovers attach to their trigger element rather than centering (modal) or pinning to an edge (drawer).
-
‘position`: side of the trigger to attach to (`:top`, `:bottom`, `:left`, `:right`). Default `:bottom`.
-
‘align`: cross-axis alignment relative to the trigger (`:start`, `:center`, `:end`). Default `:start`.
-
‘offset`: pixels between trigger edge and dialog edge. Default `4`.
-
‘auto_flip`: flip to the opposite side when the preferred placement would overflow the viewport. Default `true`.
Instance Attribute Summary collapse
-
#align ⇒ Object
Returns the value of attribute align.
-
#auto_flip ⇒ Object
Returns the value of attribute auto_flip.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#position ⇒ Object
Returns the value of attribute position.
Attributes inherited from OverlayTypeConfig
Instance Method Summary collapse
-
#initialize(position:, align:, offset:, auto_flip:, **kwargs) ⇒ PopoverConfig
constructor
A new instance of PopoverConfig.
Constructor Details
#initialize(position:, align:, offset:, auto_flip:, **kwargs) ⇒ PopoverConfig
Returns a new instance of PopoverConfig.
89 90 91 92 93 94 95 |
# File 'lib/turbo_overlay/configuration.rb', line 89 def initialize(position:, align:, offset:, auto_flip:, **kwargs) super(**kwargs) @position = position @align = align @offset = offset @auto_flip = auto_flip end |
Instance Attribute Details
#align ⇒ Object
Returns the value of attribute align.
87 88 89 |
# File 'lib/turbo_overlay/configuration.rb', line 87 def align @align end |
#auto_flip ⇒ Object
Returns the value of attribute auto_flip.
87 88 89 |
# File 'lib/turbo_overlay/configuration.rb', line 87 def auto_flip @auto_flip end |
#offset ⇒ Object
Returns the value of attribute offset.
87 88 89 |
# File 'lib/turbo_overlay/configuration.rb', line 87 def offset @offset end |
#position ⇒ Object
Returns the value of attribute position.
87 88 89 |
# File 'lib/turbo_overlay/configuration.rb', line 87 def position @position end |