-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(apis): Adding missing api files for media container - FRONT-4635
- Loading branch information
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/website/src/pages/ec/components/media/media-container/docs/api.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: API | ||
order: 3 | ||
--- | ||
|
||
import React from 'react'; | ||
import Iframe from '../../../../../website-components/Showcase/Iframe'; | ||
|
||
## Setup | ||
|
||
There are 2 ways to initialise the component. | ||
|
||
### Automatic | ||
|
||
Add `data-ecl-auto-init="MediaContainer"` attribute to component's markup: | ||
|
||
```html | ||
<div | ||
class="ecl-media-container" | ||
data-ecl-media-container | ||
data-ecl-auto-init="MediaContainer" | ||
> | ||
... | ||
</div> | ||
``` | ||
|
||
Use the `ECL` library's `autoInit()` (`ECL.autoInit()`) when your page is ready or other custom event you want to hook onto. | ||
|
||
### Manual | ||
|
||
Get target element, create an instance and invoke `init()`. | ||
|
||
Given you have 1 element with an attribute `data-ecl-media-container` on the page: | ||
|
||
```js | ||
var elt = document.querySelector('[data-ecl-media-container]'); | ||
var mediaContainer = new ECL.MediaContainer(elt); | ||
mediaContainer.init(); | ||
``` | ||
|
||
### Retrieve an existing instance | ||
|
||
If an existing instance needs to be updated, it can be retrieved this way: | ||
|
||
```js | ||
var elt = document.querySelector('[data-ecl-media-container]'); | ||
var instance = ECL.components.get(elt); | ||
``` | ||
|
||
## API | ||
|
||
<Iframe url="../../../../apis/MediaContainer.html" /> |
52 changes: 52 additions & 0 deletions
52
src/website/src/pages/eu/components/media/media-container/docs/api.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: API | ||
order: 3 | ||
--- | ||
|
||
import React from 'react'; | ||
import Iframe from '../../../../../website-components/Showcase/Iframe'; | ||
|
||
## Setup | ||
|
||
There are 2 ways to initialise the component. | ||
|
||
### Automatic | ||
|
||
Add `data-ecl-auto-init="MediaContainer"` attribute to component's markup: | ||
|
||
```html | ||
<div | ||
class="ecl-media-container" | ||
data-ecl-media-container | ||
data-ecl-auto-init="MediaContainer" | ||
> | ||
... | ||
</div> | ||
``` | ||
|
||
Use the `ECL` library's `autoInit()` (`ECL.autoInit()`) when your page is ready or other custom event you want to hook onto. | ||
|
||
### Manual | ||
|
||
Get target element, create an instance and invoke `init()`. | ||
|
||
Given you have 1 element with an attribute `data-ecl-media-container` on the page: | ||
|
||
```js | ||
var elt = document.querySelector('[data-ecl-media-container]'); | ||
var mediaContainer = new ECL.MediaContainer(elt); | ||
mediaContainer.init(); | ||
``` | ||
|
||
### Retrieve an existing instance | ||
|
||
If an existing instance needs to be updated, it can be retrieved this way: | ||
|
||
```js | ||
var elt = document.querySelector('[data-ecl-media-container]'); | ||
var instance = ECL.components.get(elt); | ||
``` | ||
|
||
## API | ||
|
||
<Iframe url="../../../../apis/MediaContainer.html" /> |