From 65f9a07e8e1a07a0689d96e051fe0efaae39c32f Mon Sep 17 00:00:00 2001 From: mister-ben Date: Fri, 22 Apr 2022 13:14:50 +0200 Subject: [PATCH] docs: Add docs for `restoreEl` option --- src/mdx-pages/guides/options.mdx | 8 ++++++++ src/mdx-pages/guides/player-workflows.mdx | 1 + 2 files changed, 9 insertions(+) diff --git a/src/mdx-pages/guides/options.mdx b/src/mdx-pages/guides/options.mdx index b7d95e32..0e3202a1 100644 --- a/src/mdx-pages/guides/options.mdx +++ b/src/mdx-pages/guides/options.mdx @@ -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` diff --git a/src/mdx-pages/guides/player-workflows.mdx b/src/mdx-pages/guides/player-workflows.mdx index e9520ac0..1e2d7b33 100644 --- a/src/mdx-pages/guides/player-workflows.mdx +++ b/src/mdx-pages/guides/player-workflows.mdx @@ -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.