Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Apr 15, 2016
2 parents 19a34ee + d9516a4 commit 2f72820
Show file tree
Hide file tree
Showing 28 changed files with 2,707 additions and 344 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# infinite-tree [![build status](https://travis-ci.org/cheton/infinite-tree.svg?branch=master)](https://travis-ci.org/cheton/infinite-tree) [![Coverage Status](https://coveralls.io/repos/cheton/infinite-tree/badge.svg)](https://coveralls.io/r/cheton/infinite-tree)
# Infinite Tree [![build status](https://travis-ci.org/cheton/infinite-tree.svg?branch=master)](https://travis-ci.org/cheton/infinite-tree) [![Coverage Status](https://coveralls.io/repos/cheton/infinite-tree/badge.svg)](https://coveralls.io/r/cheton/infinite-tree)
[![NPM](https://nodei.co/npm/infinite-tree.png?downloads=true&stars=true)](https://nodei.co/npm/infinite-tree/)

A browser-ready tree library that can efficiently display a large tree with smooth scrolling.
Expand Down Expand Up @@ -43,16 +43,16 @@ require('infinite-tree/dist/infinite-tree.css');

var data = {
id: 'fruit',
label: 'Fruit',
name: 'Fruit',
children: [{
id: 'apple',
label: 'Apple'
name: 'Apple'
}, {
id: 'banana',
label: 'Banana',
name: 'Banana',
children: [{
id: 'cherry',
label: 'Cherry',
name: 'Cherry',
loadOnDemand: true
}]
}]
Expand Down Expand Up @@ -81,7 +81,7 @@ var tree = new InfiniteTree({
},
// Render tree nodes with your own way
rowRenderer: function(node, treeOptions) {
return '<div aria-id="<node-id>" class="tree-item">' + node.label + '</div>';
return '<div aria-id="<node-id>" class="tree-item">' + node.name + '</div>';
}
});
```
Expand All @@ -104,8 +104,9 @@ console.log(node.getFirstChild().getPreviousSibling());
#### Events Usage
Learn more: [Events](https://github.com/cheton/infinite-tree/wiki/Events)
```js
tree.on('update', function() {
console.log(tree.getSelectedNode());
tree.on('contentWillUpdate', function() {
});
tree.on('contentDidUpdate', function() {
});
tree.on('openNode', function(node) {
});
Expand All @@ -115,8 +116,6 @@ tree.on('selectNode', function(node) {
});
tree.on('dropNode', function(node, evt) {
});
tree.on('scrollProgress', function(progress) {
});
```

## API Documentation
Expand Down
10 changes: 5 additions & 5 deletions dist/infinite-tree.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Change the max-height to suit your needs. */
.infinite-tree-content {
max-height: 400px;
}
.infinite-tree-scroll {
overflow: auto;
max-height: 400px; /* Change the height to suit your needs. */
}
.infinite-tree-table {
width: 100%;
}
.infinite-tree-content {
outline: 0;
Expand All @@ -20,7 +20,7 @@
.infinite-tree-content .tree-item:hover {
background: #f2fdff;
}
.infinite-tree-content .tree-item.highlight {
.infinite-tree-content .tree-item.dragover {
border: 1px dotted #ccc;
background-color: #f5f6f7;
}
Expand Down
Loading

0 comments on commit 2f72820

Please sign in to comment.