This commit is contained in:
syuilo 2020-02-19 04:08:35 +09:00
parent cef6d1d1b6
commit 804c932f60
4 changed files with 32 additions and 2 deletions

View File

@ -422,6 +422,7 @@ useObjectStorage: "オブジェクトストレージを使用"
serverLogs: "サーバーログ" serverLogs: "サーバーログ"
deleteAll: "全て削除" deleteAll: "全て削除"
showFixedPostForm: "タイムライン上部に投稿フォームを表示する" showFixedPostForm: "タイムライン上部に投稿フォームを表示する"
newNoteRecived: "新しいノートがあります"
_ago: _ago:
unknown: "謎" unknown: "謎"

View File

@ -1,5 +1,5 @@
<template> <template>
<x-notes ref="tl" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/> <x-notes ref="tl" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)" @queue="$emit('queue', $event)"/>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@ -14,10 +14,12 @@
</button> </button>
</portal> </portal>
<div class="new" v-if="queue > 0" :style="{ width: width + 'px' }"><button class="_buttonPrimary" @click="top()">{{ $t('newNoteRecived') }}</button></div>
<x-tutorial class="tutorial" v-if="$store.state.settings.tutorial != -1"/> <x-tutorial class="tutorial" v-if="$store.state.settings.tutorial != -1"/>
<x-post-form class="post-form _panel" fixed v-if="$store.state.device.showFixedPostForm"/> <x-post-form class="post-form _panel" fixed v-if="$store.state.device.showFixedPostForm"/>
<x-timeline ref="tl" :key="src === 'list' ? `list:${list.id}` : src === 'antenna' ? `antenna:${antenna.id}` : src" :src="src" :list="list" :antenna="antenna" @before="before()" @after="after()"/> <x-timeline ref="tl" :key="src === 'list' ? `list:${list.id}` : src === 'antenna' ? `antenna:${antenna.id}` : src" :src="src" :list="list" :antenna="antenna" @before="before()" @after="after()" @queue="queueUpdated"/>
</div> </div>
</template> </template>
@ -56,6 +58,8 @@ export default Vue.extend({
list: null, list: null,
antenna: null, antenna: null,
menuOpened: false, menuOpened: false,
queue: 0,
width: 0,
faAngleDown, faAngleUp, faHome, faShareAlt, faGlobe, faComments, faListUl, faSatellite, faCircle faAngleDown, faAngleUp, faHome, faShareAlt, faGlobe, faComments, faListUl, faSatellite, faCircle
}; };
}, },
@ -103,6 +107,15 @@ export default Vue.extend({
Progress.done(); Progress.done();
}, },
queueUpdated(q) {
this.width = this.$el.offsetWidth;
this.queue = q;
},
top() {
window.scroll({ top: 0, behavior: 'instant' });
},
async choose(ev) { async choose(ev) {
this.menuOpened = true; this.menuOpened = true;
const [antennas, lists] = await Promise.all([ const [antennas, lists] = await Promise.all([
@ -172,6 +185,18 @@ export default Vue.extend({
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-home { .mk-home {
> .new {
position: fixed;
z-index: 1000;
> button {
display: block;
margin: 0 auto;
padding: 8px 12px;
border-radius: 32px;
}
}
> .tutorial { > .tutorial {
margin-bottom: var(--margin); margin-bottom: var(--margin);
} }

View File

@ -31,6 +31,10 @@ export default (opts) => ({
watch: { watch: {
pagination() { pagination() {
this.init(); this.init();
},
queue() {
this.$emit('queue', this.queue.length);
} }
}, },