Class: Browser::Event::Touch

Inherits:
Browser::Event show all
Defined in:
opal/browser/event/touch.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, handlers, handles, #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


29
30
31
# File 'opal/browser/event/touch.rb', line 29

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

.supported?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'opal/browser/event/touch.rb', line 6

def self.supported?
  Browser.supports? 'Event.Touch'
end

Instance Method Details

#cancel?Boolean

TODO: implement touches and targetTouches

Returns:

  • (Boolean)

41
42
43
# File 'opal/browser/event/touch.rb', line 41

def cancel?
  name.downcase == 'touchcancel'
end

#end?Boolean

Returns:

  • (Boolean)

45
46
47
# File 'opal/browser/event/touch.rb', line 45

def end?
  name.downcase == 'touchend'
end

#leave?Boolean

Returns:

  • (Boolean)

49
50
51
# File 'opal/browser/event/touch.rb', line 49

def leave?
  name.downcase == 'touchleave'
end

#move?Boolean

Returns:

  • (Boolean)

53
54
55
# File 'opal/browser/event/touch.rb', line 53

def move?
  name.downcase == 'touchmove'
end

#start?Boolean

Returns:

  • (Boolean)

57
58
59
# File 'opal/browser/event/touch.rb', line 57

def start?
  name.downcase == 'touchstart'
end