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:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/issue.js4
-rw-r--r--app/assets/javascripts/notes/components/issue_comment_form.vue5
2 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js
index 2bee4fb045a..733ae48e882 100644
--- a/app/assets/javascripts/issue.js
+++ b/app/assets/javascripts/issue.js
@@ -42,7 +42,7 @@ class Issue {
initIssueBtnEventListeners() {
const issueFailMessage = 'Unable to update this issue at this time.';
- return $(document).on('click', 'a.btn-close, a.btn-reopen', (e) => {
+ return $(document).on('click', '.issuable-actions a.btn-close, .issuable-actions a.btn-reopen', (e) => {
var $button, shouldSubmit, url;
e.preventDefault();
e.stopImmediatePropagation();
@@ -121,7 +121,7 @@ class Issue {
static submitNoteForm(form) {
var noteText;
noteText = form.find("textarea.js-note-text").val();
- if (noteText.trim().length > 0) {
+ if (noteText && noteText.trim().length > 0) {
return form.submit();
}
}
diff --git a/app/assets/javascripts/notes/components/issue_comment_form.vue b/app/assets/javascripts/notes/components/issue_comment_form.vue
index e070ee0ff3a..9eb54bc21ed 100644
--- a/app/assets/javascripts/notes/components/issue_comment_form.vue
+++ b/app/assets/javascripts/notes/components/issue_comment_form.vue
@@ -89,7 +89,8 @@ export default {
// This is out of scope for the Notes Vue component.
// It was the shortest path to update the issue state and relevant places.
- $('.js-btn-issue-action:visible').trigger('click');
+ const btnClass = this.isIssueOpen ? 'btn-reopen' : 'btn-close';
+ $(`.js-btn-issue-action.${btnClass}:visible`).trigger('click');
}
},
discard() {
@@ -215,7 +216,7 @@ export default {
</div>
<a
@click="handleSave(true)"
- :class="{'btn-reopen': issueState === 'closed', 'btn-close': issueState === 'open'}"
+ :class="{'btn-reopen': !isIssueOpen, 'btn-close': isIssueOpen}"
class="btn btn-nr btn-comment">
{{issueActionButtonTitle}}
</a>