1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix all loneliness

This commit is contained in:
Bill Thornton 2023-09-12 17:02:06 -04:00
parent aef99ce247
commit 20381bd3ec
22 changed files with 154 additions and 223 deletions

View file

@ -130,17 +130,15 @@ class NavDrawer {
if (this.isPeeking) {
this.onMenuTouchMove(e);
} else {
if ((getTouches(e)[0]?.clientX || 0) <= options.handleSize) {
this.isPeeking = true;
} else if ((getTouches(e)[0]?.clientX || 0) <= options.handleSize) {
this.isPeeking = true;
if (e.type === 'touchstart') {
dom.removeEventListener(this.edgeContainer, 'touchmove', this.onEdgeTouchMove, {});
dom.addEventListener(this.edgeContainer, 'touchmove', this.onEdgeTouchMove, {});
}
this.onMenuTouchStart(e);
if (e.type === 'touchstart') {
dom.removeEventListener(this.edgeContainer, 'touchmove', this.onEdgeTouchMove, {});
dom.addEventListener(this.edgeContainer, 'touchmove', this.onEdgeTouchMove, {});
}
this.onMenuTouchStart(e);
}
};
@ -246,14 +244,10 @@ class NavDrawer {
} else {
this.close();
}
} else {
if (this.newPos >= 100) {
this.open();
} else {
if (this.newPos) {
this.close();
}
}
} else if (this.newPos >= 100) {
this.open();
} else if (this.newPos) {
this.close();
}
}
@ -320,19 +314,17 @@ class NavDrawer {
passive: true
});
}
} else {
if (this._edgeSwipeEnabled) {
this._edgeSwipeEnabled = false;
dom.removeEventListener(this.edgeContainer, 'touchstart', this.onEdgeTouchStart, {
passive: true
});
dom.removeEventListener(this.edgeContainer, 'touchend', this.onEdgeTouchEnd, {
passive: true
});
dom.removeEventListener(this.edgeContainer, 'touchcancel', this.onEdgeTouchEnd, {
passive: true
});
}
} else if (this._edgeSwipeEnabled) {
this._edgeSwipeEnabled = false;
dom.removeEventListener(this.edgeContainer, 'touchstart', this.onEdgeTouchStart, {
passive: true
});
dom.removeEventListener(this.edgeContainer, 'touchend', this.onEdgeTouchEnd, {
passive: true
});
dom.removeEventListener(this.edgeContainer, 'touchcancel', this.onEdgeTouchEnd, {
passive: true
});
}
}
}

View file

@ -257,12 +257,10 @@ const scrollerFactory = function (frame, options) {
} else {
container.scrollTo(0, Math.round(pos));
}
} else if (o.horizontal) {
container.scrollLeft = Math.round(pos);
} else {
if (o.horizontal) {
container.scrollLeft = Math.round(pos);
} else {
container.scrollTop = Math.round(pos);
}
container.scrollTop = Math.round(pos);
}
}
@ -506,14 +504,12 @@ const scrollerFactory = function (frame, options) {
// If the pointer was released, the path will not become longer and it's
// definitely not a drag. If not released yet, decide on next iteration
return dragging.released ? dragEnd() : undefined;
} else {
} else if (o.horizontal ? Math.abs(dragging.pathX) > Math.abs(dragging.pathY) : Math.abs(dragging.pathX) < Math.abs(dragging.pathY)) {
// If dragging path is sufficiently long we can confidently start a drag
// if drag is in different direction than scroll, ignore it
if (o.horizontal ? Math.abs(dragging.pathX) > Math.abs(dragging.pathY) : Math.abs(dragging.pathX) < Math.abs(dragging.pathY)) {
dragging.init = 1;
} else {
return dragEnd();
}
dragging.init = 1;
} else {
return dragEnd();
}
}