Simplify closing emoji panel on escape key down
This commit is contained in:
parent
48708d5738
commit
e723484498
1 changed files with 10 additions and 6 deletions
|
@ -223,7 +223,7 @@
|
|||
},
|
||||
|
||||
events: {
|
||||
'keydown': 'escapeEmojiPanel',
|
||||
keydown: 'onKeyDown',
|
||||
'submit .send': 'checkUnverifiedSendMessage',
|
||||
'input .send-message': 'updateMessageFieldSize',
|
||||
'keydown .send-message': 'updateMessageFieldSize',
|
||||
|
@ -1202,12 +1202,12 @@
|
|||
this.closeEmojiPanel();
|
||||
}
|
||||
},
|
||||
escapeEmojiPanel(e){
|
||||
// Close emoji panel on escape key press
|
||||
const keyCode = e.keyCode || e.which;
|
||||
if (keyCode == 27 && this.emojiPanel != null) {
|
||||
this.closeEmojiPanel();
|
||||
onKeyDown(event) {
|
||||
if (event.key !== 'Escape') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.closeEmojiPanel();
|
||||
},
|
||||
openEmojiPanel() {
|
||||
this.$emojiPanelContainer.outerHeight(200);
|
||||
|
@ -1217,6 +1217,10 @@
|
|||
this.updateMessageFieldSize({});
|
||||
},
|
||||
closeEmojiPanel() {
|
||||
if (this.emojiPanel === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.$emojiPanelContainer.empty().outerHeight(0);
|
||||
this.emojiPanel = null;
|
||||
this.updateMessageFieldSize({});
|
||||
|
|
Loading…
Reference in a new issue