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() {
|
mounted() {
|
||||||
eventbus.on("mentions:toggle", this.openPopup);
|
eventbus.on("mentions:toggle", this.togglePopup);
|
||||||
|
eventbus.on("escapekey", this.closePopup);
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
eventbus.off("mentions:toggle", this.openPopup);
|
eventbus.off("mentions:toggle", this.togglePopup);
|
||||||
|
eventbus.off("escapekey", this.closePopup);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
messageTime(time) {
|
messageTime(time) {
|
||||||
@ -211,7 +213,7 @@ export default {
|
|||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openPopup() {
|
togglePopup() {
|
||||||
this.isOpen = !this.isOpen;
|
this.isOpen = !this.isOpen;
|
||||||
|
|
||||||
if (this.isOpen) {
|
if (this.isOpen) {
|
||||||
@ -219,6 +221,9 @@ export default {
|
|||||||
socket.emit("mentions:get");
|
socket.emit("mentions:get");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
closePopup() {
|
||||||
|
this.isOpen = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user