Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add docs for restoreEl option #138

Merged
merged 1 commit into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/mdx-pages/guides/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,14 @@ When this option is `false` (the default), responsive breakpoints will be ignore

> Note this is about the responsiveness of the controls within the player, not responsive sizing of the pplayer itself. For that, see [fluid](#fluid).

### `restoreEl`

> Type `boolean` or `Element`, Default: false

If set to `true`, a _copy_ of the placeholder element will be made before the player is initalised. If the player is disposed, the copy is put back into the DOM in the player's place.

If set to an HTML Element, that element would replace the disposed player instead.

### `sources`

> Type: `Array`
Expand Down
1 change: 1 addition & 0 deletions src/mdx-pages/guides/player-workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Calling `dispose()` will have a few effects:
1. Trigger a `"dispose"` event on the player, allowing for any custom cleanup tasks that need to be run by your integration.
1. Remove all event listeners from the player.
1. Remove the player's DOM element(s).
1. If the [`restoreEl`](/guides/options#restoreel) option was used, then the player's DOM elements are replaced with the stored element, a copy of the original placeholder element if it were set to `true`.

Additionally, these actions are recursively applied to _all_ the player's child components.

Expand Down