mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2024-12-31 19:17:44 +01:00
refs #441 Add scroll top button in local
This commit is contained in:
parent
c4a245686e
commit
5966a71b8f
@ -1,21 +1,26 @@
|
||||
<template>
|
||||
<div id="local">
|
||||
<div class="unread">{{ unread.length > 0 ? unread.length : '' }}</div>
|
||||
<div v-shortkey="{linux: ['ctrl', 'r'], mac: ['meta', 'r']}" @shortkey="reload()">
|
||||
</div>
|
||||
<transition-group name="timeline" tag="div">
|
||||
<div class="local-timeline" v-for="message in timeline" v-bind:key="message.id">
|
||||
<toot :message="message" :filter="filter" v-on:update="updateToot" v-on:delete="deleteToot"></toot>
|
||||
</div>
|
||||
</transition-group>
|
||||
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
|
||||
</div>
|
||||
<div id="local">
|
||||
<div class="unread">{{ unread.length > 0 ? unread.length : '' }}</div>
|
||||
<div v-shortkey="{linux: ['ctrl', 'r'], mac: ['meta', 'r']}" @shortkey="reload()">
|
||||
</div>
|
||||
<transition-group name="timeline" tag="div">
|
||||
<div class="local-timeline" v-for="message in timeline" v-bind:key="message.id">
|
||||
<toot :message="message" :filter="filter" v-on:update="updateToot" v-on:delete="deleteToot"></toot>
|
||||
</div>
|
||||
</transition-group>
|
||||
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
|
||||
</div>
|
||||
<div class="upper" v-show="!heading">
|
||||
<el-button type="primary" icon="el-icon-arrow-up" @click="upper" circle>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
|
||||
export default {
|
||||
name: 'local',
|
||||
@ -117,6 +122,12 @@ export default {
|
||||
} finally {
|
||||
this.$store.commit('TimelineSpace/changeLoading', false)
|
||||
}
|
||||
},
|
||||
upper () {
|
||||
scrollTop(
|
||||
document.getElementById('scrollable'),
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -145,6 +156,12 @@ export default {
|
||||
.loading-card:empty {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.upper {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style src="@/assets/timeline-transition.scss"></style>
|
||||
|
Loading…
Reference in New Issue
Block a user