Class: SwipeToRevealUtils

Oracle® JavaScript Extension Toolkit (JET)
1.2.0

E65435-01

QuickNav

oj. SwipeToRevealUtils

Version:
  • 1.2.0
Since:
  • 1.2.0
This class provides functions for setting up and handling swipe to reveal on an offcanvas element. The offcanvas element contains contextual actions that users can perform on the element that user perform the swipe gesture on. This is most commonly found in ListView where user swipes on an item to reveal contextual actions that can be done on the item.

Styling

Class(es) Description
oj-swipetoreveal-more Apply styles to the more action item.
oj-swipetoreveal-flag Apply styles to the flag action item.
oj-swipetoreveal-alert Apply styles to the alert action item.
oj-swipetoreveal-default Apply to the default action that should get all the space when user swipes pass the threshold distance.

Constructor

new SwipeToRevealUtils()

Source:

Methods

<static> setupSwipeActions(elem, options)

Setup listeners needed for swipe actions capability.
Parameters:
Name Type Argument Description
elem Element the DOM element (of the offcanvas) that hosts the swipe actions
options Object <optional>
the options to set for swipe actions
Properties
Name Type Description
threshold number the threshold that triggers default action. If no default action is found (no item with style "oj-swipetoreveal-default") then this value is ignored. If percentage value is specified it will be calculated based on the width of the element with class "oj-offcanvas-outer-wrapper". A default value is determined if not specified. An "ojdefaultaction" event will be fired when threshold is exceed upon release.
Source:
See:

<static> tearDownSwipeActions(elem)

Removes the listener that was added in setupSwipeActions. Page authors should call tearDownSwipeActions when the content container is no longer needed.
Parameters:
Name Type Description
elem Element the DOM element (of the offcanvas) that hosts the swipe actions
Source:
See: