From b8a7c342288560cc9b96c576acad667abdeace82 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 30 Jan 2018 21:34:35 -0800 Subject: [PATCH] refactor --- routes/_components/pseudoVirtualList/PseudoVirtualList.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/_components/pseudoVirtualList/PseudoVirtualList.html b/routes/_components/pseudoVirtualList/PseudoVirtualList.html index ed3cb40..9e9f669 100644 --- a/routes/_components/pseudoVirtualList/PseudoVirtualList.html +++ b/routes/_components/pseudoVirtualList/PseudoVirtualList.html @@ -68,7 +68,7 @@ return !!($intersectionStates[key] && $intersectionStates[key].isCached) }, getHeight(key, $intersectionStates) { - return $intersectionStates[key] && $intersectionStates[key].rect.height + return $intersectionStates[key] && $intersectionStates[key].height } }, methods: { @@ -77,7 +77,7 @@ return } this.set({scrolledToPosition: true}) - console.log('scrollToPosition', rect) + console.log('scrollToPosition', rect.top) // TODO: there should be some cleaner way to grab the container element let container = document.getElementsByClassName('container')[0] if (!container) { @@ -102,7 +102,7 @@ let rect = getRectFromEntry(entry) newIntersectionStates[key] = { isIntersecting: entry.isIntersecting, - rect: rect + height: rect.height } if (scrollToItem === key) { this.scrollToPosition(rect)