IssueNotesRefactor: Show Cmd+Enter to comment tooltip.

This commit is contained in:
Fatih Acet 2017-08-21 21:48:09 +03:00
parent adc73379f3
commit 48acfb5c05
4 changed files with 15 additions and 12 deletions

View File

@ -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) {

View File

@ -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();
}
}
});

View File

@ -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",

View File

@ -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