Skip to content

Commit

Permalink
docs: update api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon committed Aug 18, 2020
1 parent 9b6581e commit 2dba5b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
19 changes: 14 additions & 5 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,23 @@ <h1>auro-popover</h1>
<demo-snippet>
<template>
<button id="button1">Popover bottom</button>
<auro-popover for="button1" placement="bottom">Hello World!</auro-popover>
<auro-popover for="button1">Hello World!</auro-popover>

<button id="button10">Popover bottom</button>
<auro-popover for="button10" placement="top">Hello World!</auro-popover>


</template>
</demo-snippet>

<demo-snippet>
<template>
<button id="button2">Popover top</button>
<auro-popover placement="top" for="button2">Hello World!</auro-popover>
<auro-popover placement="top" for="button2">Hello World!</auro-popover>
<button id="button2">Popover top</button>

<auro-popover for="button3" placement="bottom">Hello World!</auro-popover>
<button id="button3">Popover bottom</button>

</template>
</demo-snippet>

Expand All @@ -51,8 +60,8 @@ <h1>auro-popover</h1>

<demo-snippet>
<template>
<p id="button3">Hover over me, and I will pop up</p>
<auro-popover placement="top" for="button3">
<p id="button5">Hover over me, and I will pop up</p>
<auro-popover placement="top" for="button5">
I am the content in the tooltip ... listen to me.
</auro-popover>
</template>
Expand Down
8 changes: 4 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Popover attaches to an element and displays on hover/blur.

## Properties

| Property | Attribute | Type | Description |
|-------------|-------------|----------|--------------------------------------------------|
| `for` | `for` | `String` | Defines an id for an element in the DOM to trigger on hover/blur. |
| `placement` | `placement` | `String` | Expects top/bottom - default position for popover in relation to the element. |
| Property | Attribute | Type | Default | Description |
|-------------|-------------|----------|---------|--------------------------------------------------|
| `for` | `for` | `String` | | Defines an `id` for an element in the DOM to trigger on hover/blur. |
| `placement` | `placement` | `String` | "top" | Expects top/bottom - position for popover in relation to the element. |

## Methods

Expand Down
9 changes: 7 additions & 2 deletions src/auro-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ import Popover from "./popover";
/**
* Popover attaches to an element and displays on hover/blur.
*
* @attr {String} placement - Expects top/bottom - default position for popover in relation to the element.
* @attr {String} for - Defines an id for an element in the DOM to trigger on hover/blur.
* @attr {String} placement - Expects top/bottom - position for popover in relation to the element.
* @attr {String} for - Defines an `id` for an element in the DOM to trigger on hover/blur.
*/
class AuroPopover extends LitElement {
constructor() {
super();
this.placement = 'top';
}

// function to define props used within the scope of this component
static get properties() {
return {
Expand Down

0 comments on commit 2dba5b7

Please sign in to comment.