mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix suggestions
This commit is contained in:
parent
4fce7f8be5
commit
161488616f
1 changed files with 31 additions and 28 deletions
|
@ -98,40 +98,43 @@ function centerOnFocus(e, scrollSlider, horizontal) {
|
||||||
function centerOnFocusHorizontal(e) {
|
function centerOnFocusHorizontal(e) {
|
||||||
centerOnFocus(e, this, true);
|
centerOnFocus(e, this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function centerOnFocusVertical(e) {
|
function centerOnFocusVertical(e) {
|
||||||
centerOnFocus(e, this, false);
|
centerOnFocus(e, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export const centerFocus = {
|
||||||
getPosition: getPosition,
|
on: function (element, horizontal) {
|
||||||
centerFocus: {
|
if (horizontal) {
|
||||||
on: function (element, horizontal) {
|
dom.addEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||||
if (horizontal) {
|
capture: true,
|
||||||
dom.addEventListener(element, 'focus', centerOnFocusHorizontal, {
|
passive: true
|
||||||
capture: true,
|
});
|
||||||
passive: true
|
} else {
|
||||||
});
|
dom.addEventListener(element, 'focus', centerOnFocusVertical, {
|
||||||
} else {
|
capture: true,
|
||||||
dom.addEventListener(element, 'focus', centerOnFocusVertical, {
|
passive: true
|
||||||
capture: true,
|
});
|
||||||
passive: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
off: function (element, horizontal) {
|
|
||||||
if (horizontal) {
|
|
||||||
dom.removeEventListener(element, 'focus', centerOnFocusHorizontal, {
|
|
||||||
capture: true,
|
|
||||||
passive: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
dom.removeEventListener(element, 'focus', centerOnFocusVertical, {
|
|
||||||
capture: true,
|
|
||||||
passive: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
off: function (element, horizontal) {
|
||||||
|
if (horizontal) {
|
||||||
|
dom.removeEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
dom.removeEventListener(element, 'focus', centerOnFocusVertical, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getPosition: getPosition,
|
||||||
|
centerFocus: centerFocus,
|
||||||
toCenter: toCenter,
|
toCenter: toCenter,
|
||||||
toStart: toStart
|
toStart: toStart
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue