Class: PhlexUI::Command::DialogTrigger

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/command/dialog_trigger.rb

Constant Summary collapse

DEFAULT_KEYBINDINGS =
[
  "keydown.ctrl+k@window",
  "keydown.meta+k@window"
].freeze

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(keybindings: DEFAULT_KEYBINDINGS, **attrs) ⇒ DialogTrigger

Returns a new instance of DialogTrigger.



10
11
12
13
# File 'lib/phlex_ui/command/dialog_trigger.rb', line 10

def initialize(keybindings: DEFAULT_KEYBINDINGS, **attrs)
  @keybindings = keybindings.map { |kb| "#{kb}->dialog#open" }
  super(**attrs)
end

Instance Method Details

#view_templateObject



15
16
17
# File 'lib/phlex_ui/command/dialog_trigger.rb', line 15

def view_template(&)
  div(**attrs, &)
end