update components

This commit is contained in:
Luke Pulverenti 2016-08-09 13:31:31 -04:00
parent 9d8820cd93
commit bdc77cd46d
6 changed files with 13 additions and 15 deletions

View file

@ -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;