forked from hypothesis/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add examples in docs for sidebar trigger and annotation count display.
- Loading branch information
Sheetal Umesh Kumar
committed
Feb 8, 2017
1 parent
07a12c1
commit 5cb22b4
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
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,38 @@ | ||
# Interacting with the sidebar | ||
|
||
## Show the sidebar: | ||
|
||
If you need to have a custom trigger on your third party page to bring up the embedded Hypothesis | ||
sidebar, add the `data-hypothesis-trigger` attribute to the element that you want to enable. | ||
Clicking that element will cause the sidebar to open. | ||
Note, however, subsequent clicks do not hide the sidebar. | ||
|
||
Example: | ||
|
||
To add a `button` on a page to open the sidebar, simply | ||
add the `data-hypothesis-trigger` attribute. | ||
|
||
```html | ||
<button data-hypothesis-trigger> | ||
Open sidebar | ||
</button> | ||
``` | ||
|
||
## Show the public annotation count: | ||
|
||
If you need to show the total number of public annotations, page notes and orphaned annotations | ||
on your third party page where the Hypothesis sidebar is embedded, add the `data-hypothesis-annotation-count` | ||
attribute to the element that you want to enable. | ||
The contents of the enabled element will be replaced with the count of public annotations and if there are no | ||
public annotations, with 0. | ||
|
||
Example: | ||
|
||
To display the annotation count in a `div` element, simply | ||
add the `data-hypothesis-annotation-count` attribute to the `div`: | ||
|
||
```html | ||
<div data-hypothesis-annotation-count> | ||
Annotation count will appear here | ||
</div> | ||
``` |
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