Skip to content

Commit

Permalink
largely fixed issue #139
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGermaneri committed Apr 4, 2019
1 parent 461ea4f commit a5069fc
Show file tree
Hide file tree
Showing 9 changed files with 3,656 additions and 3,642 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "canvas-datagrid",
"main": "lib/main.js",
"version": "0.22.8",
"version": "0.22.10",
"ignore": [
"**/.*",
"node_modules",
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2037
2040
7,264 changes: 3,633 additions & 3,631 deletions dist/canvas-datagrid.debug.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.debug.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.map

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions lib/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define([], function () {
'use strict';
return function (self) {
var touchTimerMs = 50,
debounceTouchMove,
touchMoving,
touchScrollTimeout;
self.scrollAnimation = {};
self.touchDelta = {};
Expand Down Expand Up @@ -230,7 +232,7 @@ define([], function () {
self.selectArea(bounds);
self.draw(true);
};
self.touchmove = function (e) {
function touchMove(e) {
var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;
if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }
clearTimeout(touchScrollTimeout);
Expand Down Expand Up @@ -312,7 +314,16 @@ define([], function () {
}
self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,
self.touchScrollStart.y - self.touchDelta.y);
self.draw(true);
};
self.touchmove = function (e) {
if (touchMoving) {
return;
}
requestAnimationFrame(function () {
touchMoving = true;
touchMove(e);
touchMoving = false;
});
};
self.touchEndEvents = function (e) {
self.zoomDeltaStart = undefined;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvas-datagrid",
"version": "0.22.9",
"version": "0.22.10",
"description": "Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.",
"main": "./dist/canvas-datagrid.js",
"scripts": {
Expand Down Expand Up @@ -56,7 +56,6 @@
"mocha-phantomjs": "^4.1.0",
"mocha-phantomjs-core": "^2.1.2",
"mocha-phantomjs-istanbul": "0.0.2",
"node-coveralls": "[email protected]:nickmerwin/node-coveralls.git",
"phantomjs": "^2.1.7",
"should": "^11.2.1",
"webpack": "^3.0.0"
Expand Down
6 changes: 4 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,10 @@
// simulate very slow movement of humans
touchmove(document.body, 100, 113, grid.canvas);
touchend(document.body, 100, 113, grid.canvas);
done(assertIf(grid.scrollLeft < 400,
'Expected the scroll bar to be further along.'));
setTimeout(function () {
done(assertIf(grid.scrollLeft < 400,
'Expected the scroll bar to be further along.'));
}, 100);
}, 200);
}, 1);
});
Expand Down

0 comments on commit a5069fc

Please sign in to comment.