aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-02-28 17:11:31 +0000
committerShpuld Shpludson <shp@cock.li>2019-02-28 17:11:31 +0000
commit24f3770fb5ca47b41a9fbf8711dd614fb50537ca (patch)
treef6ad922559a05d99a323c684ffd320d976dba6f5 /src
parentefc4fa1099024e0451fd7e0d271bd0a4a25aff5a (diff)
parentd032ce2758cb57ea34e1fea2d1804656965b635e (diff)
Merge branch 'keyboard-binding' into 'develop'
Keyboard binding Closes #369 See merge request pleroma/pleroma-fe!593
Diffstat (limited to 'src')
-rw-r--r--src/components/timeline/timeline.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 25c553cb..62536bc5 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -70,14 +70,21 @@ const Timeline = {
document.addEventListener('visibilitychange', this.handleVisibilityChange, false)
this.unfocused = document.hidden
}
+ window.addEventListener('keydown', this.handleShortKey)
},
destroyed () {
window.removeEventListener('scroll', this.scrollLoad)
+ window.removeEventListener('keydown', this.handleShortKey)
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
},
methods: {
+ handleShortKey (e) {
+ 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('queueFlush', { timeline: this.timelineName, id: 0 })