Class: Dommy::DragEvent

Inherits:
MouseEvent show all
Defined in:
lib/dommy/event.rb

Overview

DragEvent — fired during drag-and-drop with a dataTransfer payload. Inherits from MouseEvent so coordinates / modifier keys are available alongside the dragged data.

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 MouseEvent

#__js_call__

Methods inherited from UIEvent

#__js_call__

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

Returns a new instance of DragEvent.



894
895
896
897
# File 'lib/dommy/event.rb', line 894

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

Instance Attribute Details

#data_transferObject (readonly)

Returns the value of attribute data_transfer.



899
900
901
# File 'lib/dommy/event.rb', line 899

def data_transfer
  @data_transfer
end

Instance Method Details

#__js_get__(key) ⇒ Object



901
902
903
904
905
906
907
908
# File 'lib/dommy/event.rb', line 901

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