Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#16782 from vingtetun/bug978632
Browse files Browse the repository at this point in the history
Bug 978632 - Prevent a click to fire when the home button is pressed on ...
  • Loading branch information
vingtetun committed Mar 3, 2014
2 parents 5e0ba61 + 15f7698 commit 11767ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/system/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,14 @@ function cancelHomeTouchend(e) {
}
}

function cancelHomeClick(e) {
if (e.pageX === 0 && e.pageY === 0) {
e.preventDefault();
e.stopImmediatePropagation();
}
}

window.addEventListener('touchstart', cancelHomeTouchstart, true);
window.addEventListener('touchend', cancelHomeTouchend, true);
window.addEventListener('mousedown', cancelHomeClick, true);
window.addEventListener('mouseup', cancelHomeClick, true);

0 comments on commit 11767ff

Please sign in to comment.