浏览代码

Allow for shift-enter to insert newlines (#1115)

* Allow for shift-enter to insert newlines

See issue #1081

* Update CHANGES.md
Joachim Vandersmissen 7 年之前
父节点
当前提交
878b106c7b
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      CHANGES.md
  2. 1 1
      src/converse-chatview.js

+ 1 - 0
CHANGES.md

@@ -11,6 +11,7 @@
 - #1091 There's now only one CSS file for all view modes.
 - #1094 Show room members who aren't currently online
 - #1106 Support for Roster Versioning
+- #1081 Allow for shift-enter to insert newlines
 - It's now also possible to edit your VCard via the UI
 - Automatically grow/shrink input as text is entered/removed
 - MP4 and MP3 files when sent as XEP-0066 Out of Band Data, are now playable directly in chat

+ 1 - 1
src/converse-chatview.js

@@ -910,7 +910,7 @@
                 keyPressed (ev) {
                     /* Event handler for when a key is pressed in a chat box textarea.
                      */
-                    if (ev.keyCode === KEY.ENTER) {
+                    if (ev.keyCode === KEY.ENTER && !ev.shiftKey) {
                         this.onFormSubmitted(ev);
                     } else if (ev.keyCode !== KEY.FORWARD_SLASH && this.model.get('chat_state') !== _converse.COMPOSING) {
                         // Set chat state to composing if keyCode is not a forward-slash