refactor virtual list

This commit is contained in:
Nolan Lawson 2018-01-25 08:23:14 -08:00
parent ab3efd2829
commit 569f384192
8 changed files with 12 additions and 12 deletions

View file

@ -15,7 +15,7 @@
{{/if}}
<script>
import Nav from './Nav.html';
import VirtualListContainer from './VirtualListContainer.html'
import VirtualListContainer from './virtualList/VirtualListContainer.html'
export default {
components: {

View file

@ -21,7 +21,7 @@
import { getTimeline } from '../_utils/mastodon/timelines'
import StatusListItem from './StatusListItem.html'
import LoadingFooter from './LoadingFooter.html'
import VirtualList from './VirtualList.html'
import VirtualList from './virtualList/VirtualList.html'
import { splice, push } from 'svelte-extras'
import { mergeStatuses } from '../_utils/statuses'
import { mark, stop } from '../_utils/marks'

View file

@ -21,9 +21,9 @@
<script>
import VirtualListLazyItem from './VirtualListLazyItem'
import VirtualListFooter from './VirtualListFooter.html'
import { virtualListStore } from '../_utils/virtualListStore'
import { virtualListStore } from './virtualListStore'
import throttle from 'lodash/throttle'
import { mark, stop } from '../_utils/marks'
import { mark, stop } from '../../_utils/marks'
const DISTANCE_FROM_BOTTOM_TO_FIRE = 400
const SCROLL_TO_BOTTOM_DELAY = 1000

View file

@ -5,11 +5,11 @@
<slot></slot>
</div>
<script>
import { virtualListStore } from '../_utils/virtualListStore'
import { virtualListStore } from './virtualListStore'
import throttle from 'lodash/throttle'
import { isFullscreen, attachFullscreenListener, detachFullscreenListener } from '../_utils/fullscreen'
import { mark, stop } from '../_utils/marks'
import { isFullscreen, attachFullscreenListener, detachFullscreenListener } from '../../_utils/fullscreen'
import { mark, stop } from '../../_utils/marks'
const SCROLL_EVENT_DELAY = 300

View file

@ -11,8 +11,8 @@
}
</style>
<script>
import { virtualListStore } from '../_utils/virtualListStore'
import { AsyncLayout } from '../_utils/AsyncLayout'
import { virtualListStore } from './virtualListStore'
import { AsyncLayout } from '../../_utils/AsyncLayout'
export default {
oncreate() {

View file

@ -21,8 +21,8 @@
}
</style>
<script>
import { virtualListStore } from '../_utils/virtualListStore'
import { AsyncLayout } from '../_utils/AsyncLayout'
import { virtualListStore } from './virtualListStore'
import { AsyncLayout } from '../../_utils/AsyncLayout'
const keyGetter = node => node.getAttribute('virtual-list-key')
const asyncLayout = new AsyncLayout(keyGetter)

View file

@ -1,5 +1,5 @@
import { Store } from 'svelte/store.js'
import { mark, stop } from '../_utils/marks'
import { mark, stop } from '../../_utils/marks'
const VIEWPORT_RENDER_FACTOR = 4