almende/chap-links-library — pull request #307 by igui (2014-07-10 18:20:27+00:00)
Title: getCluster(), getClusterIndex() and getSelection() with cluster selection info

This PR adds the ability to get a cluster information in the same way you call to ``getItem()``. For example you can get every item contained within the selected cluster. A call to ``getCluster()`` yields an Object with the cluster position within the timeline on the ``start`` attribute and each item info on the ``item`` array. Each item contains the same information as in a call to ``getItem()``. For example if you have a cluster with two events the result will be similar to.

```javascript
{
"start": "2014-06-23T21:00:00.000Z",
"type": "box",
"items": [
{
"content": "Event 1",
"start": "2014-06-23T03:00:00.000Z",
"type": "box"
},
{
"content": "Event 2",
"start": "2014-06-24T03:00:00.000Z",
"type": "box"
},
]
}
```

Also you can get 'select' events when the user clicks on a cluster (I didn't added support for adding the CSS class ``timeline-event-selected`` to a selected cluster) but can be added rather easy in the ``selectCluster()`` function.

Finally I added some documentation to the added functions :)

Best!
Igui