refs #1766 Introduce vue-virtual-scroll in Public

This commit is contained in:
AkiraFukushima 2020-10-19 23:23:16 +09:00
parent e23f3c2ad4
commit 7c0dbde88c
1 changed files with 19 additions and 17 deletions

View File

@ -2,23 +2,25 @@
<div id="public" v-shortkey="shortcutEnabled ? { next: ['j'] } : {}" @shortkey="handleKey"> <div id="public" v-shortkey="shortcutEnabled ? { next: ['j'] } : {}" @shortkey="handleKey">
<div class="unread">{{ unread.length > 0 ? unread.length : '' }}</div> <div class="unread">{{ unread.length > 0 ? unread.length : '' }}</div>
<div v-shortkey="{ linux: ['ctrl', 'r'], mac: ['meta', 'r'] }" @shortkey="reload()"></div> <div v-shortkey="{ linux: ['ctrl', 'r'], mac: ['meta', 'r'] }" @shortkey="reload()"></div>
<transition-group name="timeline" tag="div"> <DynamicScroller :items="timeline" :min-item-size="60" class="scroller" page-mode>
<div class="public-timeline" v-for="message in timeline" :key="message.uri + message.id"> <template v-slot="{ item, index, active }">
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index">
<toot <toot
:message="message" :message="item"
:filter="filter" :filter="filter"
:focused="message.uri + message.id === focusedId" :focused="item.uri + item.id === focusedId"
:overlaid="modalOpened" :overlaid="modalOpened"
v-on:update="updateToot" v-on:update="updateToot"
v-on:delete="deleteToot" v-on:delete="deleteToot"
@focusNext="focusNext" @focusNext="focusNext"
@focusPrev="focusPrev" @focusPrev="focusPrev"
@focusRight="focusSidebar" @focusRight="focusSidebar"
@selectToot="focusToot(message)" @selectToot="focusToot(item)"
> >
</toot> </toot>
</div> </DynamicScrollerItem>
</transition-group> </template>
</DynamicScroller>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor"></div> <div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor"></div>
<div :class="openSideBar ? 'upper-with-side-bar' : 'upper'" v-show="!heading"> <div :class="openSideBar ? 'upper-with-side-bar' : 'upper'" v-show="!heading">
<el-button type="primary" icon="el-icon-arrow-up" @click="upper" circle> </el-button> <el-button type="primary" icon="el-icon-arrow-up" @click="upper" circle> </el-button>