Class: Browser::Event::Wheel::Definition

Inherits:
Definition show all
Defined in:
opal/browser/event/wheel.rb

Instance Method Summary collapse

Methods inherited from Definition

#bubbles=, #cancelable=

Instance Method Details

#mode=(value) ⇒ Object


23
24
25
26
27
28
29
30
31
# File 'opal/browser/event/wheel.rb', line 23

def mode=(value)
  value = case value
    when :pixel then `WheelEvent.DOM_DELTA_PIXEL`
    when :line  then `WheelEvent.DOM_DELTA_LINE`
    when :page  then `WheelEvent.DOM_DELTA_PAGE`
  end

  `#@native.deltaMode = #{value}`
end

#x=(value) ⇒ Object


11
12
13
# File 'opal/browser/event/wheel.rb', line 11

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

#y=(value) ⇒ Object


15
16
17
# File 'opal/browser/event/wheel.rb', line 15

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

#z=(value) ⇒ Object


19
20
21
# File 'opal/browser/event/wheel.rb', line 19

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