Skip to content

Commit

Permalink
Fixes #39 redundant scroll events on update
Browse files Browse the repository at this point in the history
  • Loading branch information
NeXTs committed Jul 29, 2015
1 parent cf19db0 commit af98e9e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion clusterize.js
@@ -1,4 +1,4 @@
/*! Clusterize.js - v0.8.3 - 2015-07-30
/*! Clusterize.js - v0.9.0 - 2015-07-30
* http://NeXTs.github.com/Clusterize.js/
* Copyright (c) 2015 Denis Lukov; Licensed MIT */

Expand Down Expand Up @@ -108,6 +108,11 @@
? new_rows
: [];
var scroll_top = self.scroll_elem.scrollTop;
// fixes #39
if(rows.length * self.options.item_height < scroll_top) {
self.scroll_elem.scrollTop = 0;
last_cluster = 0;
}
self.insertToDOM(rows, cache);
self.scroll_elem.scrollTop = scroll_top;
}
Expand Down
16 changes: 8 additions & 8 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
@@ -1,6 +1,6 @@
{
"name": "clusterize.js",
"version": "0.8.3",
"version": "0.9.0",
"description": "Tiny vanilla JS plugin to display large data sets easily",
"main": "clusterize.js",
"style": "clusterize.css",
Expand Down

0 comments on commit af98e9e

Please sign in to comment.