diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-06-20 23:21:05 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-06-21 18:58:39 +0300 |
commit | a18221bfac91b78d3b997bf38e97a9d5d222101e (patch) | |
tree | 78f482f3769fd76fac0e66b9a75e22ff86baed68 /app/assets/javascripts/notes.js.coffee | |
parent | 61b59fea1ce2b703e4f01a415a8a066b8a879d6c (diff) |
Merge branch 'lbennett/gitlab-ce-18113-edit-note-shortcut-conflicting' into 'master'
Stop edit note up key shortcut conflicting with native shortcuts
## What does this MR do?
Restricts edit note shortcut to only the `up` button, if modifier keys are used it will not fire the shortcut.
## Are there points in the code the reviewer needs to double check?
Ney.
## Why was this MR needed?
UX
## What are the relevant issue numbers?
Closes #18113.
## Does this MR meet the acceptance criteria?
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4761
Diffstat (limited to 'app/assets/javascripts/notes.js.coffee')
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index e2d3241437b..17f7e180127 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -102,12 +102,15 @@ class @Notes keydownNoteText: (e) -> $this = $(this) - if $this.val() is '' and e.which is 38 #aka the up key + if $this.val() is '' and e.which is 38 and not isMetaKey e myLastNote = $("li.note[data-author-id='#{gon.current_user_id}'][data-editable]:last") if myLastNote.length myLastNoteEditBtn = myLastNote.find('.js-note-edit') myLastNoteEditBtn.trigger('click', [true, myLastNote]) + isMetaKey = (e) -> + (e.metaKey or e.ctrlKey or e.altKey or e.shiftKey) + initRefresh: -> clearInterval(Notes.interval) Notes.interval = setInterval => |