Sha256: c5e257d4f7bcbc4188db8676a34f484326cff1aa1ce94f00bb25fec160137846

Contents?: true

Size: 778 Bytes

Versions: 7

Compression:

Stored size: 778 Bytes

Contents

module Browser; class Event

class UI < Event
  def self.supported?
    Browser.supports? 'Event.UI'
  end

  class Definition < Definition
    def detail=(value)
      `#@native.detail = #{value}`
    end

    def view=(value)
      `#@native.view = #{value}`
    end
  end

  if Browser.supports? 'Event.constructor'
    def self.construct(name, desc)
      `new UIEvent(#{name}, #{desc})`
    end
  elsif Browser.supports? 'Event.create'
    def self.construct(name, desc)
      %x{
        var event = document.createEvent("UIEvent");
            event.initUIEvent(name, desc.bubbles, desc.cancelable,
              desc.view || window, desc.detail || 0);

        return event;
      }
    end
  end if supported?

  alias_native :detail
  alias_native :view
end

end; end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
atome-opal-browser-0.3.9.5 opal/browser/event/ui.rb
opal-browser-0.3.3 opal/browser/event/ui.rb
opal-browser-0.3.2 opal/browser/event/ui.rb
opal-browser-0.3.1 opal/browser/event/ui.rb
opal-browser-0.3.0 opal/browser/event/ui.rb
diamonds-0.1.5 lib/diamonds/opal/browser/event/ui.rb
opal-browser-0.2.0 opal/browser/event/ui.rb