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

Returns a new instance of ClipboardEvent.



720
721
722
723
# File 'lib/dommy/event.rb', line 720

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.



725
726
727
# File 'lib/dommy/event.rb', line 725

def clipboard_data
  @clipboard_data
end

Instance Method Details

#__js_get__(key) ⇒ Object



727
728
729
730
731
732
733
734
# File 'lib/dommy/event.rb', line 727

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