mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
9d8820cd93
commit
bdc77cd46d
6 changed files with 13 additions and 15 deletions
|
@ -13,12 +13,14 @@ define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
|
|||
|
||||
function getPosition(scrollContainer, item, horizontal) {
|
||||
|
||||
var offsets = getOffsets([scrollContainer, item]);
|
||||
var slideeOffset = offsets[0];
|
||||
var itemOffset = offsets[1];
|
||||
var slideeOffset = getBoundingClientRect(scrollContainer);
|
||||
var itemOffset = getBoundingClientRect(item);
|
||||
|
||||
var offset = horizontal ? itemOffset.left - slideeOffset.left : itemOffset.top - slideeOffset.top;
|
||||
var size = item[horizontal ? 'offsetWidth' : 'offsetHeight'];
|
||||
var size = horizontal ? itemOffset.width : itemOffset.height;
|
||||
if (!size) {
|
||||
size = item[horizontal ? 'offsetWidth' : 'offsetHeight'];
|
||||
}
|
||||
|
||||
if (horizontal) {
|
||||
offset += scrollContainer.scrollLeft;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue