forked from cybrespace/pinafore
refactor
This commit is contained in:
parent
95290afca7
commit
697170b04a
|
@ -1,7 +1,7 @@
|
||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
<VirtualList component="{{StatusListItem}}"
|
<VirtualList component="{{StatusListItem}}"
|
||||||
items="{{statuses}}"
|
items="{{statuses}}"
|
||||||
on:scrollToBottom="addMoreItems()" />
|
on:scrollToBottom="onScrollToBottom()" />
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
.timeline {
|
.timeline {
|
||||||
|
@ -37,14 +37,17 @@
|
||||||
methods: {
|
methods: {
|
||||||
splice: splice,
|
splice: splice,
|
||||||
push: push,
|
push: push,
|
||||||
addMoreItems() {
|
onScrollToBottom() {
|
||||||
mark('addMoreItems')
|
mark('onScrollToBottom')
|
||||||
let statuses = this.get('statuses')
|
let statuses = this.get('statuses')
|
||||||
if (statuses) {
|
if (statuses) {
|
||||||
let itemsToAdd = createData()
|
let itemsToAdd = createData()
|
||||||
this.splice('statuses', statuses.length, 0, ...itemsToAdd)
|
this.addItems(itemsToAdd)
|
||||||
}
|
}
|
||||||
stop('addMoreItems')
|
stop('onScrollToBottom')
|
||||||
|
},
|
||||||
|
addItems(items) {
|
||||||
|
this.splice('statuses', this.get('statuses').length, 0, ...items)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue