Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-09-08 16:07:31 +0400
committerMarin Jankovski <marin@gitlab.com>2014-09-08 16:07:31 +0400
commitdac5e6de5a679aae51ca14481bf3f7d9cad0eb3b (patch)
treebf22368bc891044b1a23e11e12cccefce50c0121 /app
parentb712ded13fb63a52500b65b9e0e26bb266f66dd4 (diff)
After comment is added, button should go back to Close button.
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js.coffee6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 51c617bd584..597d6d26b69 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -26,6 +26,7 @@ class Notes
# 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-close", @targetClose
+ $(document).on "click", ".js-comment-button", @updateCloseButton
$(document).on "keyup", ".js-note-text", @updateTargetButtons
# remove a note (in general)
@@ -496,6 +497,11 @@ class Notes
if noteText.trim().length > 0
form.submit()
+ updateCloseButton: (e) =>
+ textarea = $(e.target)
+ form = textarea.parents('form')
+ form.find('.js-note-target-close').text('Close')
+
updateTargetButtons: (e) =>
textarea = $(e.target)
form = textarea.parents('form')