Class: Browser::Event::Definition

Inherits:
Object
  • Object
show all
Includes:
Native
Defined in:
lib/diamonds/opal/browser/event/base.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(&block) ⇒ Object



11
12
13
14
15
16
# File 'lib/diamonds/opal/browser/event/base.rb', line 11

def self.new(&block)
  data = super(`{ bubbles: true, cancelable: true }`)
  block.call(data) if block

  data.to_n
end

Instance Method Details

#bubbles=(value) ⇒ Object

Set the event as bubbling.



19
20
21
# File 'lib/diamonds/opal/browser/event/base.rb', line 19

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

#cancelable=(value) ⇒ Object

Set the event as cancelable.



24
25
26
# File 'lib/diamonds/opal/browser/event/base.rb', line 24

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