refactor virtual list
This commit is contained in:
parent
ab3efd2829
commit
569f384192
|
@ -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: {
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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() {
|
|
@ -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)
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue