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 #23681 from Cwiiis/bug1062321-notifications-not-sc…
Browse files Browse the repository at this point in the history
…rollable

Bug 1062321 - Fix notification overflow not being scrollable. r=mhenretty
  • Loading branch information
Cwiiis committed Sep 4, 2014
2 parents 75da1e8 + 8e4def7 commit 915634f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/system/js/notifications.js
Expand Up @@ -8,10 +8,12 @@ var NotificationScreen = {
TOASTER_TIMEOUT: 5000,
TRANSITION_FRACTION: 0.30,
TAP_THRESHOLD: 10,
SCROLL_THRESHOLD: 10,

_notification: null,
_containerWidth: null,
_touchStartX: 0,
_touchStartY: 0,
_touchPosX: 0,
_touching: false,
_isTap: false,
Expand Down Expand Up @@ -230,10 +232,10 @@ var NotificationScreen = {
if (!target.dataset.notificationId)
return;

evt.preventDefault();
this._notification = target;
this._containerWidth = this.container.clientWidth;
this._touchStartX = evt.touches[0].pageX;
this._touchStartY = evt.touches[0].pageY;
this._touchPosX = 0;
this._touching = true;
this._isTap = true;
Expand All @@ -244,13 +246,16 @@ var NotificationScreen = {
return;
}

if (evt.touches.length !== 1) {
var touchDiffY = Math.abs(evt.touches[0].pageY - this._touchStartY);
if (evt.touches.length !== 1 ||
(this._isTap && touchDiffY >= this.SCROLL_THRESHOLD)) {
this._touching = false;
this.cancelSwipe();
return;
}

evt.preventDefault();

this._touchPosX = evt.touches[0].pageX - this._touchStartX;
if (this._touchPosX >= this.TAP_THRESHOLD) {
this._isTap = false;
Expand Down

0 comments on commit 915634f

Please sign in to comment.