Sha256: 0a280d2c74de7f7102b2121dfc985d69dfeda9d724f5323c6a29478c8184d981

Contents?: true

Size: 631 Bytes

Versions: 1

Compression:

Stored size: 631 Bytes

Contents

class Event < `$.Event`
  def current_target
    `$(#{self}.currentTarget)`
  end

  alias_native :default_prevented?, :isDefaultPrevented

  alias_native :prevent_default, :preventDefault

  def page_x
    `#{self}.pageX`
  end

  def page_y
    `#{self}.pageY`
  end

  alias_native :propagation_stopped?, :propagationStopped

  alias_native :stop_propagation, :stopPropagation

  def target
    %x{
      if (#{self}._opalTarget) {
        return #{self}._opalTarget;
      }
      
      return #{self}._opalTarget = $(#{self}.target);
    }
  end

  def type
    `#{self}.type`
  end

  def which
    `#{self}.which`
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-jquery-0.0.1 lib/opal-jquery/event.rb