diff options
-rw-r--r-- | app/command_shortcuts.go | 3 | ||||
-rw-r--r-- | i18n/en.json | 4 | ||||
-rw-r--r-- | webapp/components/create_post.jsx | 10 |
3 files changed, 16 insertions, 1 deletions
diff --git a/app/command_shortcuts.go b/app/command_shortcuts.go index e3c342af1..da3537961 100644 --- a/app/command_shortcuts.go +++ b/app/command_shortcuts.go @@ -37,7 +37,7 @@ func (me *ShortcutsProvider) GetCommand(T goi18n.TranslateFunc) *model.Command { } func (me *ShortcutsProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse { - shortcutIds := [28]string{ + shortcutIds := [29]string{ "api.command_shortcuts.header", // Nav shortcuts "api.command_shortcuts.nav.header", @@ -58,6 +58,7 @@ func (me *ShortcutsProvider) DoCommand(args *model.CommandArgs, message string) "api.command_shortcuts.msgs.reprint_prev", "api.command_shortcuts.msgs.reprint_next", "api.command_shortcuts.msgs.edit", + "api.command_shortcuts.msgs.reply", "api.command_shortcuts.msgs.comp_username", "api.command_shortcuts.msgs.comp_channel", "api.command_shortcuts.msgs.comp_emoji", diff --git a/i18n/en.json b/i18n/en.json index b71c1e915..7922115b0 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -748,6 +748,10 @@ "translation": "UP (in empty input field): Edit your last message in the current channel\n" }, { + "id": "api.command_shortcuts.msgs.reply", + "translation": "SHIFT+UP (in empty input field): Reply to the most recent message in the current channel\n" + }, + { "id": "api.command_shortcuts.msgs.header", "translation": "#### Messages\n\n" }, diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index 22fba0e73..74104cf2a 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -529,6 +529,16 @@ export default class CreatePost extends React.Component { channelId: lastPost.channel_id, comments: PostStore.getCommentCount(lastPost) }); + } else if (!e.ctrlKey && !e.metaKey && !e.altKey && e.shiftKey && e.keyCode === KeyCodes.UP && this.state.message === '') { + e.preventDefault(); + if (document.createEvent) { + var evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + document.getElementById('commentIcon0').dispatchEvent(evt); + } else if (document.createEventObject) { + var evObj = document.createEventObject(); + document.getElementById('commentIcon0').fireEvent('onclick', evObj); + } } if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && (e.keyCode === Constants.KeyCodes.UP || e.keyCode === Constants.KeyCodes.DOWN)) { |