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

Merge branch 'jellyfin:master' into master

This commit is contained in:
Jack Vanier 2021-08-14 20:30:45 -04:00 committed by GitHub
commit 2aecd89d6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 1513 additions and 1241 deletions

View file

@ -103,6 +103,8 @@ function centerOnFocusVertical(e) {
export const centerFocus = {
on: function (element, horizontal) {
element.setAttribute(`data-scroll-mode-${horizontal ? 'x' : 'y'}`, 'custom');
if (horizontal) {
dom.addEventListener(element, 'focus', centerOnFocusHorizontal, {
capture: true,
@ -116,6 +118,8 @@ export const centerFocus = {
}
},
off: function (element, horizontal) {
element.removeAttribute(`data-scroll-mode-${horizontal ? 'x' : 'y'}`);
if (horizontal) {
dom.removeEventListener(element, 'focus', centerOnFocusHorizontal, {
capture: true,