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}} {{/if}}
<script> <script>
import Nav from './Nav.html'; import Nav from './Nav.html';
import VirtualListContainer from './VirtualListContainer.html' import VirtualListContainer from './virtualList/VirtualListContainer.html'
export default { export default {
components: { components: {

View file

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

View file

@ -21,9 +21,9 @@
<script> <script>
import VirtualListLazyItem from './VirtualListLazyItem' import VirtualListLazyItem from './VirtualListLazyItem'
import VirtualListFooter from './VirtualListFooter.html' import VirtualListFooter from './VirtualListFooter.html'
import { virtualListStore } from '../_utils/virtualListStore' import { virtualListStore } from './virtualListStore'
import throttle from 'lodash/throttle' 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 DISTANCE_FROM_BOTTOM_TO_FIRE = 400
const SCROLL_TO_BOTTOM_DELAY = 1000 const SCROLL_TO_BOTTOM_DELAY = 1000

View file

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

View file

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

View file

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

View file

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