BigW Consortium Gitlab

Commit 57f52b9e by Filipa Lacerda

Restore r shortcut

parent 2faf28fe
...@@ -20,7 +20,7 @@ import './shortcuts_navigation'; ...@@ -20,7 +20,7 @@ import './shortcuts_navigation';
Mousetrap.bind('m', this.openSidebarDropdown.bind(this, 'milestone')); Mousetrap.bind('m', this.openSidebarDropdown.bind(this, 'milestone'));
Mousetrap.bind('r', (function(_this) { Mousetrap.bind('r', (function(_this) {
return function() { return function() {
_this.replyWithSelectedText(); _this.replyWithSelectedText(isMergeRequest);
return false; return false;
}; };
})(this)); })(this));
...@@ -38,9 +38,15 @@ import './shortcuts_navigation'; ...@@ -38,9 +38,15 @@ import './shortcuts_navigation';
} }
} }
ShortcutsIssuable.prototype.replyWithSelectedText = function() { ShortcutsIssuable.prototype.replyWithSelectedText = function(isMergeRequest) {
var quote, documentFragment, el, selected, separator; var quote, documentFragment, el, selected, separator;
var replyField = $('.js-main-target-form #note_note'); let replyField;
if (isMergeRequest) {
replyField = $('.js-main-target-form #note_note');
} else {
replyField = $('.js-main-target-form .js-vue-comment-form');
}
documentFragment = window.gl.utils.getSelectedFragment(); documentFragment = window.gl.utils.getSelectedFragment();
if (!documentFragment) { if (!documentFragment) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment