Skip to content

Commit

Permalink
Add backspace in tchatmessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gannon001 committed May 7, 2019
1 parent f1ba98f commit 5e84496
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src_htmlPhone/src/components/Tchat/TchatMessage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="phone_app">
<PhoneTitle :title="channelName" backgroundColor="#090f20" @back="onBack"/>
<PhoneTitle :title="channelName" backgroundColor="#090f20" @back="onQuit"/>
<div class="phone_content">
<div class="elements" ref="elementsDiv">
<div class="element" v-for='(elem) in tchatMessages'
Expand Down Expand Up @@ -91,6 +91,10 @@ export default {
}
},
onBack () {
if (this.useMouse === true && document.activeElement.tagName !== 'BODY') return
this.onQuit()
},
onQuit () {
this.$router.push({ name: 'tchat.channel' })
},
formatTime (time) {
Expand All @@ -103,10 +107,10 @@ export default {
this.$bus.$on('keyUpArrowDown', this.onDown)
this.$bus.$on('keyUpArrowUp', this.onUp)
this.$bus.$on('keyUpEnter', this.onEnter)
this.$bus.$on('keyUpBackspace', this.onBack)
} else {
this.currentSelect = -1
}
this.$bus.$on('keyUpBackspace', this.onBack)
this.setChannel(this.$route.params.channel)
},
mounted () {
Expand Down

0 comments on commit 5e84496

Please sign in to comment.