From 3618e8b527a0f40cae4226ae59d22376aba57b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 21 Jan 2014 19:47:57 +0100 Subject: [PATCH] FEATURE: CTRL+ENTER and CMD+ENTER shortcut to submit the current message --- .../javascripts/discourse/views/composer/composer_view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/composer/composer_view.js b/app/assets/javascripts/discourse/views/composer/composer_view.js index 9c468b47cbe..650e5047b06 100644 --- a/app/assets/javascripts/discourse/views/composer/composer_view.js +++ b/app/assets/javascripts/discourse/views/composer/composer_view.js @@ -107,9 +107,14 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, { }, keyDown: function(e) { - // If the user hit ESC if (e.which === 27) { + // ESC this.get('controller').hitEsc(); + return false; + } else if (e.which === 13 && (e.ctrlKey || e.metaKey)) { + // CTRL+ENTER or CMD+ENTER + this.get('controller').send('save'); + return false; } },