Class: Dommy::SubmitEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/dommy/event.rb

Overview

SubmitEvent — fired on a form at submission. Exposes the button/input that triggered submission via submitter (null for form.requestSubmit() with no argument or an implicit submission). Frameworks (Turbo) read event.submitter to locate the clicked control.

Constant Summary

Constants inherited from Event

Event::AT_TARGET, Event::BUBBLING_PHASE, Event::CAPTURING_PHASE, Event::NONE

Instance Attribute Summary collapse

Attributes inherited from Event

#type

Instance Method Summary collapse

Methods inherited from Event

#__internal_clear_propagation_flags__, #__internal_mark_trusted__, #__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_run_passive__, #__internal_set_current_target__, #__internal_set_dispatch_flag__, #__internal_set_event_phase__, #__js_call__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?

Methods included from Bridge::Methods

included

Constructor Details

#initialize(type, init = nil) ⇒ SubmitEvent

Returns a new instance of SubmitEvent.



749
750
751
752
# File 'lib/dommy/event.rb', line 749

def initialize(type, init = nil)
  super
  @submitter = read_init(init, "submitter")
end

Instance Attribute Details

#submitterObject (readonly)

Returns the value of attribute submitter.



747
748
749
# File 'lib/dommy/event.rb', line 747

def submitter
  @submitter
end

Instance Method Details

#__js_get__(key) ⇒ Object



754
755
756
757
758
# File 'lib/dommy/event.rb', line 754

def __js_get__(key)
  return @submitter if key == "submitter"

  super
end