mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared components
This commit is contained in:
parent
f2e02b7c2d
commit
feb3d5ae05
12 changed files with 76 additions and 110 deletions
|
@ -172,15 +172,7 @@ define(['dom'], function (dom) {
|
|||
return elem;
|
||||
}
|
||||
|
||||
function getWindowData(win, documentElement) {
|
||||
|
||||
return {
|
||||
clientTop: documentElement.clientTop,
|
||||
clientLeft: documentElement.clientLeft
|
||||
};
|
||||
}
|
||||
|
||||
function getOffset(elem, windowData) {
|
||||
function getOffset(elem) {
|
||||
|
||||
var box;
|
||||
|
||||
|
@ -197,16 +189,16 @@ define(['dom'], function (dom) {
|
|||
};
|
||||
}
|
||||
return {
|
||||
top: box.top - windowData.clientTop,
|
||||
left: box.left - windowData.clientLeft,
|
||||
top: box.top,
|
||||
left: box.left,
|
||||
width: box.width,
|
||||
height: box.height
|
||||
};
|
||||
}
|
||||
|
||||
function getViewportBoundingClientRect(elem, windowData) {
|
||||
function getViewportBoundingClientRect(elem) {
|
||||
|
||||
var offset = getOffset(elem, windowData);
|
||||
var offset = getOffset(elem);
|
||||
|
||||
var posY = offset.top;
|
||||
var posX = offset.left;
|
||||
|
@ -243,9 +235,7 @@ define(['dom'], function (dom) {
|
|||
|
||||
var focusableContainer = dom.parentWithClass(activeElement, 'focusable');
|
||||
|
||||
var doc = activeElement.ownerDocument;
|
||||
var windowData = getWindowData(doc.defaultView, doc.documentElement);
|
||||
var rect = getViewportBoundingClientRect(activeElement, windowData);
|
||||
var rect = getViewportBoundingClientRect(activeElement);
|
||||
var focusableElements = [];
|
||||
|
||||
var focusable = container.querySelectorAll(focusableQuery);
|
||||
|
@ -264,7 +254,7 @@ define(['dom'], function (dom) {
|
|||
// continue;
|
||||
//}
|
||||
|
||||
var elementRect = getViewportBoundingClientRect(curr, windowData);
|
||||
var elementRect = getViewportBoundingClientRect(curr);
|
||||
|
||||
// not currently visible
|
||||
if (!elementRect.width && !elementRect.height) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue