aboutsummaryrefslogtreecommitdiff
path: root/src/components/timeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/timeline')
-rw-r--r--src/components/timeline/timeline.js6
-rw-r--r--src/components/timeline/timeline.vue57
2 files changed, 45 insertions, 18 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 19d9a9ac..5e24bd15 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -78,13 +78,15 @@ const Timeline = {
},
methods: {
handleShortKey (e) {
+ // Ignore when input fields are focused
+ if (['textarea', 'input'].includes(e.target.tagName.toLowerCase())) return
if (e.key === '.') this.showNewStatuses()
},
showNewStatuses () {
if (this.newStatusCount === 0) return
if (this.timeline.flushMarker !== 0) {
- this.$store.commit('clearTimeline', { timeline: this.timelineName })
+ this.$store.commit('clearTimeline', { timeline: this.timelineName, excludeUserId: true })
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
this.fetchOlderStatuses()
} else {
@@ -137,7 +139,7 @@ const Timeline = {
if (top < 15 &&
!this.paused &&
!(this.unfocused && this.$store.state.config.pauseOnUnfocused)
- ) {
+ ) {
this.showNewStatuses()
} else {
this.paused = true
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index e6a8d458..1fc52083 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -2,41 +2,66 @@
<div :class="classes.root">
<div :class="classes.header">
<div class="title">
- {{title}}
+ {{ title }}
</div>
- <div @click.prevent class="loadmore-error alert error" v-if="timelineError">
- {{$t('timeline.error_fetching')}}
+ <div
+ v-if="timelineError"
+ class="loadmore-error alert error"
+ @click.prevent
+ >
+ {{ $t('timeline.error_fetching') }}
</div>
- <button @click.prevent="showNewStatuses" class="loadmore-button" v-if="timeline.newStatusCount > 0 && !timelineError">
- {{$t('timeline.show_new')}}{{newStatusCountStr}}
+ <button
+ v-if="timeline.newStatusCount > 0 && !timelineError"
+ class="loadmore-button"
+ @click.prevent="showNewStatuses"
+ >
+ {{ $t('timeline.show_new') }}{{ newStatusCountStr }}
</button>
- <div @click.prevent class="loadmore-text faint" v-if="!timeline.newStatusCount > 0 && !timelineError">
- {{$t('timeline.up_to_date')}}
+ <div
+ v-if="!timeline.newStatusCount > 0 && !timelineError"
+ class="loadmore-text faint"
+ @click.prevent
+ >
+ {{ $t('timeline.up_to_date') }}
</div>
</div>
<div :class="classes.body">
<div class="timeline">
<conversation
v-for="status in timeline.visibleStatuses"
- class="status-fadein"
:key="status.id"
+ class="status-fadein"
:statusoid="status"
:collapsable="true"
/>
</div>
</div>
<div :class="classes.footer">
- <div v-if="count===0" class="new-status-notification text-center panel-footer faint">
- {{$t('timeline.no_statuses')}}
+ <div
+ v-if="count===0"
+ class="new-status-notification text-center panel-footer faint"
+ >
+ {{ $t('timeline.no_statuses') }}
</div>
- <div v-else-if="bottomedOut" class="new-status-notification text-center panel-footer faint">
- {{$t('timeline.no_more_statuses')}}
+ <div
+ v-else-if="bottomedOut"
+ class="new-status-notification text-center panel-footer faint"
+ >
+ {{ $t('timeline.no_more_statuses') }}
</div>
- <a v-else-if="!timeline.loading" href="#" v-on:click.prevent='fetchOlderStatuses()'>
- <div class="new-status-notification text-center panel-footer">{{$t('timeline.load_older')}}</div>
+ <a
+ v-else-if="!timeline.loading"
+ href="#"
+ @click.prevent="fetchOlderStatuses()"
+ >
+ <div class="new-status-notification text-center panel-footer">{{ $t('timeline.load_older') }}</div>
</a>
- <div v-else class="new-status-notification text-center panel-footer">
- <i class="icon-spin3 animate-spin"/>
+ <div
+ v-else
+ class="new-status-notification text-center panel-footer"
+ >
+ <i class="icon-spin3 animate-spin" />
</div>
</div>
</div>