This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/frontend/src/utils/show-hide/show-hide.md
2019-07-03 11:59:02 +02:00

722 B

ShowHide

Allows to toggle the visibilty of an element by clicking another element.

Attribute: uw-show-hide

Params:

  • data-show-hide-id: string (optional)
    If this param is given the state of the utility will be persisted in the clients local storage.
  • data-show-hide-collapsed: boolean (optional)
    If this param is present the ShowHide utility will be collapsed. This value will be overruled by any value stored in the LocalStorage.
  • data-show-hide-align: 'right' (optional)
    Where to put the arrow that marks the element as a ShowHide toggle. Left of toggle by default.

Example usage:

<div>
  <div uw-show-hide>Click me
  <div>This will be toggled
  <div>This will be toggled as well