Sha256: 61c04bdf0cf2a49d3231859894b141f212dfd6102c836e7a2f3f09f0e5f22120

Contents?: true

Size: 409 Bytes

Versions: 3

Compression:

Stored size: 409 Bytes

Contents

module Hyalite
  module DOM
    module Event
      EVENT_CLASSES = {
        'click' => MouseEvent,
        'keydown' => KeyboardEvent
      }

      def self.create(event)
        type = `event.type`
        event_class = EVENT_CLASSES[type]
        if event_class
          event_class.new(event)
        end
      end

      def target
        Node.create(`self.native.target`)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyalite-0.2.0 lib/hyalite/dom/event.rb
hyalite-0.1.1 client/hyalite/dom/event.rb
hyalite-0.1.0 client/hyalite/dom/event.rb