Commit 48acfb5c authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Show Cmd+Enter to comment tooltip.

parent adc73379
...@@ -237,7 +237,7 @@ class AwardsHandler { ...@@ -237,7 +237,7 @@ class AwardsHandler {
addAward(votesBlock, awardUrl, emoji, checkMutuality, callback) { addAward(votesBlock, awardUrl, emoji, checkMutuality, callback) {
const isMainAwardsBlock = votesBlock.closest('.js-issue-note-awards').length; 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_', ''); const id = votesBlock.attr('id').replace('note_', '');
$('.emoji-menu').removeClass('is-visible'); $('.emoji-menu').removeClass('is-visible');
...@@ -287,15 +287,8 @@ class AwardsHandler { ...@@ -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() { getVotesBlock() {
if (this.isInIssuePage()) { if (gl.utils.isInIssuePage()) {
const $el = $('.js-add-award.is-active').closest('.note.timeline-entry'); const $el = $('.js-add-award.is-active').closest('.note.timeline-entry');
if ($el.length) { if ($el.length) {
......
...@@ -44,7 +44,10 @@ $(document).on('keydown.quick_submit', '.js-quick-submit', (e) => { ...@@ -44,7 +44,10 @@ $(document).on('keydown.quick_submit', '.js-quick-submit', (e) => {
if (!$submitButton.attr('disabled')) { if (!$submitButton.attr('disabled')) {
$submitButton.trigger('click', [e]); $submitButton.trigger('click', [e]);
$submitButton.disable();
if (!gl.utils.isInIssuePage) {
$submitButton.disable();
}
} }
}); });
......
...@@ -27,6 +27,13 @@ ...@@ -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) { w.gl.utils.ajaxGet = function(url) {
return $.ajax({ return $.ajax({
type: "GET", type: "GET",
......
...@@ -258,10 +258,10 @@ ...@@ -258,10 +258,10 @@
<div class="note-form-actions"> <div class="note-form-actions">
<div class="pull-left btn-group append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"> <div class="pull-left btn-group append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown">
<button <button
@click="handleSave()" @click.prevent="handleSave()"
:disabled="isSubmitButtonDisabled" :disabled="isSubmitButtonDisabled"
class="btn btn-create comment-btn js-comment-button js-comment-submit-button" class="btn btn-create comment-btn js-comment-button js-comment-submit-button"
type="button"> type="submit">
{{commentButtonTitle}} {{commentButtonTitle}}
</button> </button>
<button <button
......
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