diff options
Diffstat (limited to 'app/assets/javascripts/shortcuts_issuable.js')
-rw-r--r-- | app/assets/javascripts/shortcuts_issuable.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/shortcuts_issuable.js b/app/assets/javascripts/shortcuts_issuable.js index 3f3a8a9dfd9..235bf4f95ec 100644 --- a/app/assets/javascripts/shortcuts_issuable.js +++ b/app/assets/javascripts/shortcuts_issuable.js @@ -1,7 +1,5 @@ /*= require mousetrap */ - - /*= require shortcuts_navigation */ (function() { @@ -43,16 +41,20 @@ if (selected.trim() === "") { return; } + // Put a '>' character before each non-empty line in the selection quote = _.map(selected.split("\n"), function(val) { if (val.trim() !== '') { return "> " + val + "\n"; } }); + // If replyField already has some content, add a newline before our quote separator = replyField.val().trim() !== "" && "\n" || ''; replyField.val(function(_, current) { return current + separator + quote.join('') + "\n"; }); + // Trigger autosave for the added text replyField.trigger('input'); + // Focus the input field return replyField.focus(); } }; |