Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8260 from crdlc/bug-843832
Browse files Browse the repository at this point in the history
Bug 843832 - [Homescreen] Tapping icons causes swipes [r=arcturus](cherry picked from commit 8983833)
  • Loading branch information
Cristian Rodriguez authored and jhford committed Feb 25, 2013
1 parent 14a6e68 commit dd29452
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/homescreen/js/grid.js
Expand Up @@ -76,7 +76,7 @@ const GridManager = (function() {
if (evt.preventPanning === true) {
return;
}

// Start panning immediately but only disable
// the tap when we've moved far enough.
deltaX = getX(evt) - startEvent.pageX;
Expand Down Expand Up @@ -246,9 +246,11 @@ const GridManager = (function() {

function onTouchEnd(deltaX, evt) {
var page = currentPage;
/* Bigger than panning threshold or fast gesture */
// If movement over 25% of the screen size or
// fast movement over threshold for tapping, then swipe
if (Math.abs(deltaX) > panningThreshold ||
touchEndTimestamp - touchStartTimestamp < kPageTransitionDuration) {
(Math.abs(deltaX) > tapThreshold &&
touchEndTimestamp - touchStartTimestamp < kPageTransitionDuration)) {
var forward = dirCtrl.goesForward(deltaX);
if (forward && currentPage < pages.length - 1) {
page = page + 1;
Expand Down Expand Up @@ -356,7 +358,7 @@ const GridManager = (function() {

return;
}

togglePagesVisibility(start, end);

// Force a reflow otherwise the newPage appears immediately because it is
Expand Down

0 comments on commit dd29452

Please sign in to comment.