Skip to content

Commit

Permalink
Fixed rows-height calculation in case single row provided only. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
NeXTs committed Dec 2, 2015
1 parent 3bb411a commit 21912dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clusterize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Clusterize.js - v0.14.0 - 2015-11-11
/*! Clusterize.js - v0.15.0 - 2015-12-02
* http://NeXTs.github.com/Clusterize.js/
* Copyright (c) 2015 Denis Lukov; Licensed MIT */

Expand Down Expand Up @@ -187,7 +187,7 @@
opts.cluster_height = 0
if( ! rows.length) return;
var nodes = this.content_elem.children;
opts.item_height = nodes[Math.ceil(nodes.length / 2)].offsetHeight;
opts.item_height = nodes[Math.floor(nodes.length / 2)].offsetHeight;
// consider table's border-spacing
if(opts.tag == 'tr' && getStyle('borderCollapse', this.content_elem) != 'collapse')
opts.item_height += parseInt(getStyle('borderSpacing', this.content_elem)) || 0;
Expand Down
4 changes: 2 additions & 2 deletions clusterize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clusterize.js",
"version": "0.14.0",
"version": "0.15.0",
"description": "Tiny vanilla JS plugin to display large data sets easily",
"main": "clusterize.js",
"style": "clusterize.css",
Expand Down

0 comments on commit 21912dc

Please sign in to comment.