summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-20 22:14:25 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-23 03:27:16 +0100
commit60a73bab1c83c9f8065aa1c642a7ca2c80cd6d2b (patch)
tree2e890e7b0e3270315875cc629038d88c2667051e /apps/comments
parent968da5ef23efa722163c0d5250d82a39367a1571 (diff)
downloadnextcloud-server-60a73bab1c83c9f8065aa1c642a7ca2c80cd6d2b.tar.gz
nextcloud-server-60a73bab1c83c9f8065aa1c642a7ca2c80cd6d2b.zip
Submit comments with Enter and use Shift+Enter for new lines
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/comments')
-rw-r--r--apps/comments/js/commentstabview.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 7398a709421..0d752877b04 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -517,9 +517,10 @@
$field.toggleClass('error', limitExceeded);
$submitButton.prop('disabled', limitExceeded);
- //submits form on ctrl+Enter or cmd+Enter
- if (ev.keyCode === 13 && (ev.ctrlKey || ev.metaKey)) {
+ // Submits form with Enter, but Shift+Enter is a new line
+ if (ev.keyCode === 13 && !ev.shiftKey) {
$submitButton.click();
+ ev.preventDefault();
}
},