Class: UI::ContextMenu
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::ContextMenu
- Includes:
- ContextMenuBehavior
- Defined in:
- app/components/ui/context_menu.rb
Overview
ContextMenu - Phlex implementation
Container for context menus triggered by right-click. Uses ContextMenuBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(classes: "", **attributes) ⇒ ContextMenu
constructor
A new instance of ContextMenu.
- #view_template(&block) ⇒ Object
Methods included from ContextMenuBehavior
#context_menu_classes, #context_menu_data_attributes, #context_menu_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ ContextMenu
Returns a new instance of ContextMenu.
20 21 22 23 |
# File 'app/components/ui/context_menu.rb', line 20 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
25 26 27 28 29 |
# File 'app/components/ui/context_menu.rb', line 25 def view_template(&block) div(**.deep_merge(@attributes)) do yield if block_given? end end |