Skip to content

Commit 1e89385

Browse files
committed
init
0 parents  commit 1e89385

File tree

10 files changed

+1794
-0
lines changed

10 files changed

+1794
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/
2+
.*
3+
!/.gitignore

README.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
3+
# Tagbar
4+
5+
[Demo](https://mrtcode.github.io/tagbar/demo.html)
6+
7+
Write tags
8+
9+
Insert/remove tags
10+
11+
* No dependencies
12+
* Has an autosuggester
13+
* Supports touch devices
14+
15+
## Usage
16+
17+
Download [Tagbar]() and include `tagbar.js` and `tagbar.css` files on your page.
18+
19+
```
20+
<link rel="stylesheet" href="tagbar.css">
21+
<script src="tagbar.js"></script>
22+
```
23+
24+
Alternatively, you can require it as a module if you use Browserify
25+
26+
```
27+
var tagbar = require('./tagbar.js');
28+
```
29+
30+
Create a tagbar inside a container. Pass an element or element id as a container.
31+
32+
```
33+
var tagbar = new Tagbar({
34+
container: 'container-id',
35+
});
36+
37+
tagbar.setTags(['creative', 'holidays']);
38+
39+
var tags = tagbar.getTags();
40+
```
41+
42+
Attach event handlers
43+
44+
```
45+
var tagbar = new Tagbar({
46+
container: 'container-id',
47+
onAdd: function (tag) {
48+
console.log(tag);
49+
},
50+
onRemove: function (tag) {
51+
console.log(tag);
52+
},
53+
onSuggest: function (query, callback) {
54+
callback(['suggestion1', 'suggestion2', 'suggestion3']);
55+
}
56+
});
57+
```
58+
59+
60+
61+
62+
63+
64+

0 commit comments

Comments
 (0)