Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes notification bar swipe behavior (bug 796482)

  • Loading branch information...
commit a48ed092963c4bc16c4016a3c9bbaa027922e943 1 parent 812846b
@deanlandolt authored
Showing with 8 additions and 14 deletions.
  1. +8 −14 apps/system/js/utility_tray.js
View
22 apps/system/js/utility_tray.js
@@ -93,7 +93,13 @@ var UtilityTray = {
onTouchMove: function ut_onTouchMove(touch) {
var screenHeight = this.overlay.getBoundingClientRect().height;
- var dy = -(this.startY - touch.pageY);
+ var y = touch.pageY;
+ if (y > this.lastY)
+ this.opening = true;
+ else if (y < this.lastY)
+ this.opening = false;
+ this.lastY = y;
+ var dy = -(this.startY - y);
if (this.shown)
dy += screenHeight;
dy = Math.min(screenHeight, dy);
@@ -104,19 +110,7 @@ var UtilityTray = {
},
onTouchEnd: function ut_onTouchEnd(touch) {
- var screenHeight = this.overlay.getBoundingClientRect().height;
- var dy = -(this.startY - touch.pageY);
- var offset = Math.abs(dy);
-
- if (!this.shown && offset == 0)
- this.hide(true);
-
- if ((!this.shown && offset > screenHeight / 4) ||
- (this.shown && offset < 10)) {
- this.show();
- } else {
- this.hide();
- }
+ this.opening ? this.show() : this.hide();
},
hide: function ut_hide(instant) {
Please sign in to comment.
Something went wrong with that request. Please try again.