diff options
author | Vincent Chan <plus.vincchan@gmail.com> | 2016-05-03 12:22:46 +0200 |
---|---|---|
committer | Vincent Chan <plus.vincchan@gmail.com> | 2016-05-03 12:26:05 +0200 |
commit | bc0d136511efdef4cb15abd1963e4834c97caf89 (patch) | |
tree | 147fccf37cf8dfe278bc10c6d7924527e639a455 /apps/comments | |
parent | 7ac1cb68f699e1a1d9a6bd4f2f59a7068d39e4b2 (diff) | |
download | nextcloud-server-bc0d136511efdef4cb15abd1963e4834c97caf89.tar.gz nextcloud-server-bc0d136511efdef4cb15abd1963e4834c97caf89.zip |
adds functionality to submit comments with cmd+Enter
Diffstat (limited to 'apps/comments')
-rw-r--r-- | apps/comments/js/commentstabview.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 2d6671557fd..7cda071d311 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -172,7 +172,7 @@ this.$el.find('.avatar').avatar(OC.getCurrentUser().uid, 28); } this.delegateEvents(); - this.$el.find('textarea').on('keyup input change', this._onTypeComment); + this.$el.find('textarea').on('keydown input change', this._onTypeComment); }, _formatItem: function(commentModel) { @@ -273,7 +273,7 @@ // spawn form $comment.after($formRow); $formRow.data('commentEl', $comment); - $formRow.find('textarea').on('keyup input change', this._onTypeComment); + $formRow.find('textarea').on('keydown input change', this._onTypeComment); // copy avatar element from original to avoid flickering $formRow.find('.avatar').replaceWith($comment.find('.avatar').clone()); @@ -302,8 +302,8 @@ $field.toggleClass('error', limitExceeded); $submitButton.prop('disabled', limitExceeded); - //submits form on ctrlEnter - if (ev.keyCode === 13 && ev.ctrlKey) { + //submits form on ctrl+Enter or cmd+Enter + if (ev.keyCode === 13 && (ev.ctrlKey || ev.metaKey)) { $submitButton.click(); } }, |