Skip to content

Commit

Permalink
Fixes #3 Chrome scrolling issue on OS X 10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Lukov committed Aug 5, 2015
1 parent e12e4ce commit c4ab015
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
17 changes: 15 additions & 2 deletions clusterize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Clusterize.js - v0.9.1 - 2015-08-01
/*! Clusterize.js - v0.10.0 - 2015-08-05
* http://NeXTs.github.com/Clusterize.js/
* Copyright (c) 2015 Denis Lukov; Licensed MIT */

Expand All @@ -19,7 +19,8 @@
all[0];
){}
return v > 4 ? v : document.documentMode;
}());
}()),
is_mac = navigator.platform.toLowerCase().indexOf('mac') + 1;

var Clusterize = function(data) {
if( ! (this instanceof Clusterize))
Expand Down Expand Up @@ -82,7 +83,19 @@

// adding scroll handler
var last_cluster = false,
scroll_debounce = 0,
pointer_events_set = false,
scrollEv = function() {
// fixes scrolling issue on Mac #3
if (is_mac) {
if( ! pointer_events_set) self.content_elem.style.pointerEvents = 'none';
pointer_events_set = true;
clearTimeout(scroll_debounce);
scroll_debounce = setTimeout(function () {
self.content_elem.style.pointerEvents = 'auto';
pointer_events_set = false;
}, 50);
}
if (last_cluster != (last_cluster = self.getClusterNum()))
self.insertToDOM(rows, cache);
},
Expand Down
21 changes: 11 additions & 10 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.9.1",
"version": "0.10.0",
"description": "Tiny vanilla JS plugin to display large data sets easily",
"main": "clusterize.js",
"style": "clusterize.css",
Expand Down

0 comments on commit c4ab015

Please sign in to comment.