Make esc key close mentions window (#4365)
* Mentions: rename method to what it's doing * Mentions: make <esc> dismiss the window
This commit is contained in:
parent
6dfd51bb57
commit
9dbf647f7e
@ -185,10 +185,12 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
eventbus.on("mentions:toggle", this.openPopup);
|
||||
eventbus.on("mentions:toggle", this.togglePopup);
|
||||
eventbus.on("escapekey", this.closePopup);
|
||||
},
|
||||
destroyed() {
|
||||
eventbus.off("mentions:toggle", this.openPopup);
|
||||
eventbus.off("mentions:toggle", this.togglePopup);
|
||||
eventbus.off("escapekey", this.closePopup);
|
||||
},
|
||||
methods: {
|
||||
messageTime(time) {
|
||||
@ -211,7 +213,7 @@ export default {
|
||||
this.isOpen = false;
|
||||
}
|
||||
},
|
||||
openPopup() {
|
||||
togglePopup() {
|
||||
this.isOpen = !this.isOpen;
|
||||
|
||||
if (this.isOpen) {
|
||||
@ -219,6 +221,9 @@ export default {
|
||||
socket.emit("mentions:get");
|
||||
}
|
||||
},
|
||||
closePopup() {
|
||||
this.isOpen = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user