Class: Browser::Event::Wheel

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

Defined Under Namespace

Classes: Definition

Instance Attribute Summary

Attributes inherited from Browser::Event

#callback, #on

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Browser::Event

aliases, #arguments, #arguments=, class_for, create, #initialize, #name, name_for, new, #off, #prevent, #prevented?, #stop, #stop!, #stopped?, #target

Constructor Details

This class inherits a constructor from Browser::Event

Class Method Details

.construct(name, desc) ⇒ Object



32
33
34
# File 'opal/browser/event/wheel.rb', line 32

def self.construct(name, desc)
  `new WheelEvent(#{name}, #{desc})`
end

.supported?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'opal/browser/event/wheel.rb', line 4

def self.supported?
  not $$[:WheelEvent].nil?
end

Instance Method Details

#modeObject



40
41
42
43
44
45
46
# File 'opal/browser/event/wheel.rb', line 40

def mode
  case `#@native.deltaMode`
    when `WheelEvent.DOM_DELTA_PIXEL` then :pixel
    when `WheelEvent.DOM_DELTA_LINE`  then :line
    when `WheelEvent.DOM_DELTA_PAGE`  then :page
  end
end