1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-09-01 01:01:47 +02:00

Updated Core API (markdown)

Antonio Laguna
2017-04-19 18:14:46 +02:00
parent 953b9f8da4
commit dec5384b14

@@ -136,4 +136,91 @@ Called once the slide **has finished** transitioning into view. The `event.detai
}
```
## `Slide` class
## `Slide` class
Unless doing [plugin development](Plugin-development) there should be no need to deal with Slides.
### API
<dl>
<dt><a href="#hide">hide()</a></dt>
<dd><p>Hides the node and removes the class that makes it "active".</p></dd>
<dt><a href="#show">show()</a></dt>
<dd><p>Shows the node and adds the class that makes it "active".</p></dd>
<dt><a href="#moveAfterLast">moveAfterLast()</a></dt>
<dd><p>Moves the section to the bottom of the section's list.</p></dd>
<dt><a href="#moveBeforeFirst">moveBeforeFirst()</a></dt>
<dd><p>Moves the section to the top of the section's list.</p></dd>
<dt><a href="#enable">enable()</a></dt>
<dd><p>Fires an enable event.</p></dd>
<dt><a href="#disable">disable()</a></dt>
<dd><p>Fires a disable event.</p></dd>
<dt><a href="#Slide.isCandidate">Slide.isCandidate(el)</a></dt>
<dd><p>Checks whether an element is a valid candidate to be a slide by ensuring it's a "section" element.</p></dd>
<dt><a href="#Slide.getSectionFromEl">Slide.getSectionFromEl(el)</a></dt>
<dd><p>Gets the section element from an inner element.</p></dd>
</dl>
<a name="hide"></a>
### `slide.hide()`
Hides the node and removes the class that makes it "active".
<a name="show"></a>
### slide.show()
Shows the node and adds the class that makes it "active".
<a name="moveAfterLast"></a>
### slide.moveAfterLast()
Moves the section to the bottom of the section's list.
**Emits**: <code>dom:leave</code>, <code>dom:enter</code>
<a name="moveBeforeFirst"></a>
### slide.moveBeforeFirst()
Moves the section to the top of the section's list.
**Emits**: <code>dom:leave</code>, <code>dom:enter</code>
<a name="enable"></a>
### slide.enable()
Fires an enable event.
**Emits**: <code>slide:enable</code>
<a name="disable"></a>
### slide.disable()
Fires a disable event.
**Emits**: <code>slide:disable</code>
<a name="Slide.isCandidate"></a>
### Slide.isCandidate(el) ⇒ <code>boolean</code>
Checks whether an element is a valid candidate to be a slide by ensuring it's a "section" element.
**Returns**: <code>boolean</code> - Whether is candidate or not.
| Param | Type | Description |
| --- | --- | --- |
| el | <code>Element</code> | Element to be checked. |
<a name="Slide.getSectionFromEl"></a>
### Slide.getSectionFromEl(el) ⇒ <code>Object</code>
Gets the section element from an inner element.
**Returns**: <code>Object</code> - A map with the section and the
position of the section.
```javascript
{
section: Element, // Section DOM node
i: Number // Section position on the list
}
```
### Properties
### Events