Commit 5200686b authored by Alfredo Sumaran's avatar Alfredo Sumaran

Disable submit button and dropdown when submitt comment form

parent d9dedac8
......@@ -112,10 +112,17 @@ require('./task_list');
// when issue status changes, we need to refresh data
$(document).on("issuable:change", this.refresh);
$(document).on('submit', '.js-main-target-form', this.disableDropdown)
// when a key is clicked on the notes
return $(document).on("keydown", ".js-note-text", this.keydownNoteText);
};
Notes.prototype.disableDropdown = function(e) {
const $form = $(e.target);
$form.find('.js-note-new-discussion').disable();
};
Notes.prototype.cleanBinding = function() {
$(document).off("ajax:success", ".js-main-target-form");
$(document).off("ajax:success", ".js-discussion-note-form");
......
- noteable_type = @note.noteable_type
.pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
%button.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
Comment
%input.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button{ type: 'submit', value: 'Comment' }
- if @note.can_be_discussion_note?
= button_tag type: 'button', class: 'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion', data: { 'dropdown-trigger' => '#resolvable-comment-menu' } do
= icon('caret-down')
......
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