Class: Dommy::FocusEvent

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

Overview

‘FocusEvent` — focus / blur / focusin / focusout. `relatedTarget` is the element gaining/losing focus on the other side.

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_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) ⇒ FocusEvent

Returns a new instance of FocusEvent.



940
941
942
943
# File 'lib/dommy/event.rb', line 940

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

Instance Attribute Details

Returns the value of attribute related_target.



945
946
947
# File 'lib/dommy/event.rb', line 945

def related_target
  @related_target
end

Instance Method Details

#__js_get__(key) ⇒ Object



947
948
949
950
951
952
953
954
# File 'lib/dommy/event.rb', line 947

def __js_get__(key)
  case key
  when "relatedTarget"
    @related_target
  else
    super
  end
end