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, #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



27
28
29
# File 'opal/browser/event/touch.rb', line 27

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

.supported?Boolean

Returns:

  • (Boolean)


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

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

Instance Method Details

#cancel?Boolean

TODO: implement touches and targetTouches

Returns:

  • (Boolean)


39
40
41
# File 'opal/browser/event/touch.rb', line 39

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

#end?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'opal/browser/event/touch.rb', line 43

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

#leave?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'opal/browser/event/touch.rb', line 47

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

#move?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'opal/browser/event/touch.rb', line 51

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

#start?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'opal/browser/event/touch.rb', line 55

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