Class: Panda::Core::Admin::SlideoverComponent
- Defined in:
- app/components/panda/core/admin/slideover_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #before_render ⇒ Object
-
#footer(&block) ⇒ Object
Legacy method for backwards compatibility.
-
#initialize(title: "Settings", open: false, **attrs) ⇒ SlideoverComponent
constructor
A new instance of SlideoverComponent.
Constructor Details
#initialize(title: "Settings", open: false, **attrs) ⇒ SlideoverComponent
Returns a new instance of SlideoverComponent.
9 10 11 12 13 |
# File 'app/components/panda/core/admin/slideover_component.rb', line 9 def initialize(title: "Settings", open: false, **attrs) @title = title @open = open super(**attrs) end |
Instance Attribute Details
#open ⇒ Object (readonly)
Returns the value of attribute open.
15 16 17 |
# File 'app/components/panda/core/admin/slideover_component.rb', line 15 def open @open end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
15 16 17 |
# File 'app/components/panda/core/admin/slideover_component.rb', line 15 def title @title end |
Instance Method Details
#before_render ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/components/panda/core/admin/slideover_component.rb', line 17 def before_render # Store main content if provided # In ViewComponent, content is already rendered HTML (SafeBuffer), not a block if content.present? @content_html = content end end |
#footer(&block) ⇒ Object
Legacy method for backwards compatibility
26 27 28 29 30 31 32 |
# File 'app/components/panda/core/admin/slideover_component.rb', line 26 def (&block) if defined?(view_context) && view_context @footer_html = view_context.capture(&block) else @footer_block = block end end |