Skip to content

Commit

Permalink
Dont measure height if element is hidden. Fixes #98
Browse files Browse the repository at this point in the history
  • Loading branch information
NeXTs committed Feb 25, 2017
1 parent 3f13ec6 commit 973efb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion clusterize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Clusterize.js - v0.17.4 - 2017-02-20
/*! Clusterize.js - v0.17.5 - 2017-02-25
* http://NeXTs.github.com/Clusterize.js/
* Copyright (c) 2015 Denis Lukov; Licensed GPLv3 */

Expand Down Expand Up @@ -177,6 +177,8 @@
if( ! rows.length) return;
var nodes = this.content_elem.children;
var node = nodes[Math.floor(nodes.length / 2)];
// don't measure height if element is hidden. fixes #98
if( ! node.offsetParent) return;
opts.item_height = node.offsetHeight;
// consider table's border-spacing
if(opts.tag == 'tr' && getStyle('borderCollapse', this.content_elem) != 'collapse')
Expand Down
14 changes: 7 additions & 7 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.17.4",
"version": "0.17.5",
"description": "Tiny vanilla JS plugin to display large data sets easily",
"main": "clusterize.js",
"style": "clusterize.css",
Expand Down

0 comments on commit 973efb7

Please sign in to comment.