Commit 094a8a57 authored by JC Brand's avatar JC Brand

Fixes #1201 Emoji picker appears when pressing enter

parent 0833478d
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- New config setting [enable_muc_push](https://conversejs.org/docs/html/configuration.html#enable-muc-push) - New config setting [enable_muc_push](https://conversejs.org/docs/html/configuration.html#enable-muc-push)
- #1182 MUC occupants without nick or JID created - #1182 MUC occupants without nick or JID created
- #1184 Notification error when message has no body - #1184 Notification error when message has no body
- #1201 Emoji picker appears when pressing enter
## 4.0.0 (2018-09-07) ## 4.0.0 (2018-09-07)
......
...@@ -61696,7 +61696,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -61696,7 +61696,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
} else if (ev.keyCode === _converse.keycodes.ESCAPE) { } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
return this.onEscapePressed(ev); return this.onEscapePressed(ev);
} else if (ev.keyCode === _converse.keycodes.ENTER) { } else if (ev.keyCode === _converse.keycodes.ENTER) {
_.invoke(this.emoji_dropdown, 'toggle'); if (this.emoji_dropdown && u.isVisible(this.emoji_dropdown.el.querySelector('.emoji-picker'))) {
this.emoji_dropdown.toggle();
}
return this.onFormSubmitted(ev); return this.onFormSubmitted(ev);
} else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) { } else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) {
...@@ -61891,6 +61893,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -61891,6 +61893,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.renderEmojiPicker(); this.renderEmojiPicker();
const dropdown_el = this.el.querySelector('.toggle-smiley.dropup'); const dropdown_el = this.el.querySelector('.toggle-smiley.dropup');
this.emoji_dropdown = new bootstrap.Dropdown(dropdown_el, true); this.emoji_dropdown = new bootstrap.Dropdown(dropdown_el, true);
this.emoji_dropdown.el = dropdown_el;
this.emoji_dropdown.toggle(); this.emoji_dropdown.toggle();
} }
}, },
...@@ -898,7 +898,9 @@ ...@@ -898,7 +898,9 @@
} else if (ev.keyCode === _converse.keycodes.ESCAPE) { } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
return this.onEscapePressed(ev); return this.onEscapePressed(ev);
} else if (ev.keyCode === _converse.keycodes.ENTER) { } else if (ev.keyCode === _converse.keycodes.ENTER) {
_.invoke(this.emoji_dropdown, 'toggle'); if (this.emoji_dropdown && u.isVisible(this.emoji_dropdown.el.querySelector('.emoji-picker'))) {
this.emoji_dropdown.toggle();
}
return this.onFormSubmitted(ev); return this.onFormSubmitted(ev);
} else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) { } else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) {
return this.editEarlierMessage(); return this.editEarlierMessage();
...@@ -1065,6 +1067,7 @@ ...@@ -1065,6 +1067,7 @@
const dropdown_el = this.el.querySelector('.toggle-smiley.dropup'); const dropdown_el = this.el.querySelector('.toggle-smiley.dropup');
this.emoji_dropdown = new bootstrap.Dropdown(dropdown_el, true); this.emoji_dropdown = new bootstrap.Dropdown(dropdown_el, true);
this.emoji_dropdown.el = dropdown_el;
this.emoji_dropdown.toggle(); this.emoji_dropdown.toggle();
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment