commit: 24f3770fb5ca47b41a9fbf8711dd614fb50537ca
parent: efc4fa1099024e0451fd7e0d271bd0a4a25aff5a
Author: Shpuld Shpludson <shp@cock.li>
Date: Thu, 28 Feb 2019 17:11:31 +0000
Merge branch 'keyboard-binding' into 'develop'
Keyboard binding
Closes #369
See merge request pleroma/pleroma-fe!593
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git 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 })