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 {
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) {
......
......@@ -44,8 +44,11 @@ $(document).on('keydown.quick_submit', '.js-quick-submit', (e) => {
if (!$submitButton.attr('disabled')) {
$submitButton.trigger('click', [e]);
if (!gl.utils.isInIssuePage) {
$submitButton.disable();
}
}
});
// If the user tabs to a submit button on a `js-quick-submit` form, display a
......
......@@ -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",
......
......@@ -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
......
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