After comment is added, button should go back to Close button.
This commit is contained in:
parent
b712ded13f
commit
dac5e6de5a
1 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,7 @@ class Notes
|
||||||
# Reopen and close actions for Issue/MR combined with note form submit
|
# Reopen and close actions for Issue/MR combined with note form submit
|
||||||
$(document).on "click", ".js-note-target-reopen", @targetReopen
|
$(document).on "click", ".js-note-target-reopen", @targetReopen
|
||||||
$(document).on "click", ".js-note-target-close", @targetClose
|
$(document).on "click", ".js-note-target-close", @targetClose
|
||||||
|
$(document).on "click", ".js-comment-button", @updateCloseButton
|
||||||
$(document).on "keyup", ".js-note-text", @updateTargetButtons
|
$(document).on "keyup", ".js-note-text", @updateTargetButtons
|
||||||
|
|
||||||
# remove a note (in general)
|
# remove a note (in general)
|
||||||
|
@ -496,6 +497,11 @@ class Notes
|
||||||
if noteText.trim().length > 0
|
if noteText.trim().length > 0
|
||||||
form.submit()
|
form.submit()
|
||||||
|
|
||||||
|
updateCloseButton: (e) =>
|
||||||
|
textarea = $(e.target)
|
||||||
|
form = textarea.parents('form')
|
||||||
|
form.find('.js-note-target-close').text('Close')
|
||||||
|
|
||||||
updateTargetButtons: (e) =>
|
updateTargetButtons: (e) =>
|
||||||
textarea = $(e.target)
|
textarea = $(e.target)
|
||||||
form = textarea.parents('form')
|
form = textarea.parents('form')
|
||||||
|
|
Loading…
Reference in a new issue