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


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

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


9
10
11
# File 'opal/browser/event/wheel.rb', line 9

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

#y=(value) ⇒ Object


13
14
15
# File 'opal/browser/event/wheel.rb', line 13

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

#z=(value) ⇒ Object


17
18
19
# File 'opal/browser/event/wheel.rb', line 17

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