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

Merge pull request #4774 from thornbill/owner-of-a-lonely-if

This commit is contained in:
Bill Thornton 2023-09-14 10:53:21 -04:00 committed by GitHub
commit bb44ba022d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 155 additions and 223 deletions

View file

@ -258,12 +258,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);
}
}
@ -507,14 +505,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();
}
}