Class: Dommy::ClipboardEvent

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

Overview

‘ClipboardEvent` — fires for copy / cut / paste. Carries the `clipboardData` payload as a DataTransfer.

Spec: w3c.github.io/clipboard-apis/#clipboard-event-interface

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) ⇒ ClipboardEvent

Returns a new instance of ClipboardEvent.



867
868
869
870
# File 'lib/dommy/event.rb', line 867

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

Instance Attribute Details

#clipboard_dataObject (readonly)

Returns the value of attribute clipboard_data.



872
873
874
# File 'lib/dommy/event.rb', line 872

def clipboard_data
  @clipboard_data
end

Instance Method Details

#__js_get__(key) ⇒ Object



874
875
876
877
878
879
880
881
# File 'lib/dommy/event.rb', line 874

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