mirror of
https://github.com/flarum/core.git
synced 2025-10-27 05:31:29 +01:00
18 lines
665 B
TypeScript
18 lines
665 B
TypeScript
/**
|
|
* The `slidable` utility adds touch gestures to an element so that it can be
|
|
* slid away to reveal controls underneath, and then released to activate those
|
|
* controls.
|
|
*
|
|
* It relies on the element having children with particular CSS classes.
|
|
*
|
|
* The function returns a record with a `reset` proeprty. This is a function
|
|
* which reverts the slider to its original position. This should be called,
|
|
* for example, when a controls dropdown is closed.
|
|
*
|
|
* @param {HTMLElement | SVGElement | Element} element
|
|
* @return {{ reset : () => void }}
|
|
*/
|
|
export default function slidable(element: HTMLElement | SVGElement | Element): {
|
|
reset: () => void;
|
|
};
|