Class: Dommy::CompositionEvent

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

Overview

‘CompositionEvent` — IME composition events (compositionstart / compositionupdate / compositionend). `data` holds the composing text.

Constant Summary

Constants inherited from Event

Event::JS_METHOD_NAMES

Instance Attribute Summary collapse

Attributes inherited from Event

#type

Instance Method Summary collapse

Methods inherited from Event

#__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_set_current_target__, #__js_call__, #__js_method_names__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?

Constructor Details

#initialize(type, init = nil) ⇒ CompositionEvent

Returns a new instance of CompositionEvent.



740
741
742
743
# File 'lib/dommy/event.rb', line 740

def initialize(type, init = nil)
  super
  @data = (read_init(init, "data") || "").to_s
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



745
746
747
# File 'lib/dommy/event.rb', line 745

def data
  @data
end

Instance Method Details

#__js_get__(key) ⇒ Object



747
748
749
750
751
752
753
754
# File 'lib/dommy/event.rb', line 747

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