Marionette.Actions Class
Actions is used to denote a set of actions that have to be executed in particular order.
Item Index
Methods
cancel
()
Object
cancel() can only be called if press() has already be called on this element. cancel() send 'touchcancel' event to whenever the finger is.
Returns:
self.
doubleTap
-
element
-
x
-
y
doubleTap() performs a double tap on the element.
Parameters:
-
element
ObjectMarionette.Element to double tap on.
-
x
Numberoptional, x-coordinate relative to the top-left corner of the element of the last touch.
-
y
Numberoptional, y-coordinate relative to the top-left corner of the element of the last touch.
Returns:
self.
flick
-
element
-
x1
-
y1
-
x2
-
y2
-
duration
flick() sends a sequence of touch events: touchstart, touchmove, touchend. It scrolls the page in any direction within period of time provided(duration).
Parameters:
-
element
ObjectMarionette.Element to double tap on.
-
x1
Numberstarting x-coordinates of the finger relative to the element.
-
y1
Numberstarting y-coordinates of the finger relative to the element.
-
x2
Numberending x-coordinates of the finger relative to the element.
-
y2
Numberending y-coordinates of the finger relative to the element.
-
duration
Numberoptional, time needed for the flick gesture for complete.
Returns:
self.
longPress
-
element
-
time
Sends 'touchstart', then wait for 'time' seconds, and send 'touchend' eventually. longPress() cannot follow any active touch, i.e. the finger must leave the screen before longPress() gets called.
Parameters:
-
element
ObjectMarionette.Element of the long press.
-
time
Numberthe waiting time between touchstart and touchend.
Returns:
self.
move
-
element
move() can only be called if press() has already be called on this element. move() send 'touchmove' event which moves the finger to target element.
Parameters:
-
element
ObjectMarionette.Element of the move gesture.
Returns:
self.
moveByOffset
-
x
-
y
moveByOffset() can only be called if press() has already be called on this element. moveByOffset() send 'touchmove' event.
Parameters:
Returns:
self.
perform
-
callback
perform() will send the whole action chain built so far to the server side for execution.
Parameters:
-
callback
Functioncallback when the perform completes.
Returns:
self.
press
-
element
-
x
-
y
Send a 'touchstart' event to this element. If no coordinates are given, it will be targeted at the center of the element. If given, it will be targeted at the (x,y) coordinates relative to the top-left corner of the element.
Parameters:
-
element
ObjectMarionette.Element to press on.
-
x
Numberoptional, x-coordinate to tap, relative to the top-left corner of the element.
-
y
Numberoptional, y-coordinate to tap, relative to the top-left corner of the element.
Returns:
self.
release
()
Object
release() can only be called if press() has already be called on this element. Send 'touchend' event to whenever the finger is.
Returns:
self.
tap
-
element
-
x
-
y
tap() performs a quick tap on the target. action.tap() is essentially action.press().release().
Parameters:
-
element
ObjectMarionette.Element to press/release on.
-
x
Numberoptional, x-coordinate relative to the top-left corner of the element of the last touch.
-
y
Numberoptional, y-coordinate relative to the top-left corner of the element of the last touch.
Returns:
self.