FEATURE: CTRL+ENTER and CMD+ENTER shortcut to submit the current message

This commit is contained in:
Régis Hanol 2014-01-21 19:47:57 +01:00
parent 7fb1b4dded
commit 3618e8b527
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}
},