Class: PhlexKit::ContextMenuTrigger
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ContextMenuTrigger
- Defined in:
- app/components/phlex_kit/context_menu/context_menu_trigger.rb
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ContextMenuTrigger
constructor
A new instance of ContextMenuTrigger.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ContextMenuTrigger
Returns a new instance of ContextMenuTrigger.
3 |
# File 'app/components/phlex_kit/context_menu/context_menu_trigger.rb', line 3 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template ⇒ Object
4 5 6 7 8 |
# File 'app/components/phlex_kit/context_menu/context_menu_trigger.rb', line 4 def view_template(&) # tabindex 0 so the keyboard context-menu key (Menu / Shift+F10) can # reach it, and so Escape has somewhere to return focus to. div(**mix({ class: "pk-context-menu-trigger", tabindex: "0", data: { phlex_kit__context_menu_target: "trigger", action: "contextmenu->phlex-kit--context-menu#open" } }, @attrs), &) end |