Class: EdgeSwipeDetector

EdgeSwipeDetector

new EdgeSwipeDetector()

Detects user gestures for moving between apps using edge gestures.

Detects user gestures for moving between apps using edge gestures. Gestures are listened for on the previous/next elements, which is above the app container. Forwards events when they are not relevant to the app iframe.

Source:

Members

_settingEnabled

Whether or not the setting is enabled.

Whether or not the setting is enabled.

Source:

Methods

_forward()

Once we identify the gesture as something other than an horizontal swipe we replay and start forwarding the touch events:

  • either sending them to the current app through the sendTouchEvent mozbrowser API
  • or redispatching the events to the system app if they were outside the app frame

When redispatching, since we don't know on which element they should be dispatched (the target is always the gesture-panel) we send a custom event instead.

Once we identify the gesture as something other than an horizontal swipe we replay and start forwarding the touch events:

  • either sending them to the current app through the sendTouchEvent mozbrowser API
  • or redispatching the events to the system app if they were outside the app frame

When redispatching, since we don't know on which element they should be dispatched (the target is always the gesture-panel) we send a custom event instead.

Source:

_outsideApp(e)

Detects whether or not a touch event is outside of an app container.

Detects whether or not a touch event is outside of an app container.

Parameters:
Name Type Description
e Object

The relevant touch event.

Source:

_updateEnabled()

Enables or disables the previous/next triggers.

Enables or disables the previous/next triggers.

Source:

autoSwipe(direction)

Swipes a page when we receive an event from gecko.

Swipes a page when we receive an event from gecko.

Parameters:
Name Type Description
direction String
Source:

debugUpdate()

Called when the edgesgesture.debug setting is changed.

Called when the edgesgesture.debug setting is changed.

Source:

handleEvent(e)

General event handler.

General event handler.

Parameters:
Name Type Description
e Object
Source:

settingUpdate()

Called when the edgesgesture.enabled setting is changed.

Called when the edgesgesture.enabled setting is changed.

Source:

start()

Starts EdgeSwipeDetector and begins listening for events.

Starts EdgeSwipeDetector and begins listening for events.

Source: