diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-08-21 21:48:09 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-08-21 21:48:09 +0300 |
commit | 48acfb5c058df92e419a4012c4a2effff9f5ddfa (patch) | |
tree | ce20e7418681e4ce03b3501ad53e888b3c4f6b8f /app/assets/javascripts | |
parent | adc73379f3bc41c2ffa50e0437a101458ff65f58 (diff) |
IssueNotesRefactor: Show Cmd+Enter to comment tooltip.
Diffstat (limited to 'app/assets/javascripts')
4 files changed, 15 insertions, 12 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index cdd54ae4772..22fa1f2a609 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -237,7 +237,7 @@ class AwardsHandler { addAward(votesBlock, awardUrl, emoji, checkMutuality, callback) { const isMainAwardsBlock = votesBlock.closest('.js-issue-note-awards').length; - if (this.isInIssuePage() && !isMainAwardsBlock) { + if (gl.utils.isInIssuePage() && !isMainAwardsBlock) { const id = votesBlock.attr('id').replace('note_', ''); $('.emoji-menu').removeClass('is-visible'); @@ -287,15 +287,8 @@ class AwardsHandler { } } - isInIssuePage() { - const page = gl.utils.getPagePath(1); - const action = gl.utils.getPagePath(2); - - return page === 'issues' && action === 'show'; - } - getVotesBlock() { - if (this.isInIssuePage()) { + if (gl.utils.isInIssuePage()) { const $el = $('.js-add-award.is-active').closest('.note.timeline-entry'); if ($el.length) { diff --git a/app/assets/javascripts/behaviors/quick_submit.js b/app/assets/javascripts/behaviors/quick_submit.js index bc693616460..ca0eae32387 100644 --- a/app/assets/javascripts/behaviors/quick_submit.js +++ b/app/assets/javascripts/behaviors/quick_submit.js @@ -44,7 +44,10 @@ $(document).on('keydown.quick_submit', '.js-quick-submit', (e) => { if (!$submitButton.attr('disabled')) { $submitButton.trigger('click', [e]); - $submitButton.disable(); + + if (!gl.utils.isInIssuePage) { + $submitButton.disable(); + } } }); diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index 52465f182c8..c2b56ee5904 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -27,6 +27,13 @@ } }; + w.gl.utils.isInIssuePage = () => { + const page = gl.utils.getPagePath(1); + const action = gl.utils.getPagePath(2); + + return page === 'issues' && action === 'show'; + } + w.gl.utils.ajaxGet = function(url) { return $.ajax({ type: "GET", diff --git a/app/assets/javascripts/notes/components/issue_comment_form.vue b/app/assets/javascripts/notes/components/issue_comment_form.vue index 421ed7ab686..cb19dc9eb4b 100644 --- a/app/assets/javascripts/notes/components/issue_comment_form.vue +++ b/app/assets/javascripts/notes/components/issue_comment_form.vue @@ -258,10 +258,10 @@ <div class="note-form-actions"> <div class="pull-left btn-group append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"> <button - @click="handleSave()" + @click.prevent="handleSave()" :disabled="isSubmitButtonDisabled" class="btn btn-create comment-btn js-comment-button js-comment-submit-button" - type="button"> + type="submit"> {{commentButtonTitle}} </button> <button |