Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7324 from crdlc/bug-827331

Bug 827331 - Long press is fired while slow panning (about contextmenu e...
  • Loading branch information...
commit 6eaab8f107de0db9cde4c2a7f9e339da8ece7dbb 2 parents 3c3c104 + f08c266
@vingtetun vingtetun authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 apps/homescreen/js/grid.js
View
10 apps/homescreen/js/grid.js
@@ -32,7 +32,7 @@ const GridManager = (function() {
right: 0
};
- var startEvent, isPanning = false;
+ var startEvent, isPanning = false, deltaX;
function handleEvent(evt) {
switch (evt.type) {
@@ -40,6 +40,7 @@ const GridManager = (function() {
touchStartTimestamp = MouseEventShim.getEventTimestamp(evt);
evt.stopPropagation();
startEvent = evt;
+ deltaX = 0;
attachEvents();
break;
@@ -48,7 +49,7 @@ const GridManager = (function() {
// Start panning immediately but only disable
// the tap when we've moved far enough.
- var deltaX = evt.clientX - startEvent.clientX;
+ deltaX = evt.clientX - startEvent.clientX;
if (deltaX == 0)
return;
document.body.dataset.transitioning = 'true';
@@ -170,6 +171,11 @@ const GridManager = (function() {
break;
case 'contextmenu':
+ if (deltaX !== 0) {
+ evt.stopImmediatePropagation();
+ return;
+ }
+
if (currentPage > 1 && 'isIcon' in evt.target.dataset) {
evt.stopImmediatePropagation();
Homescreen.setMode('edit');
Please sign in to comment.
Something went wrong with that request. Please try again.