Commit adc73379 authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: First comment and then close the issue.

parent e0d583cb
...@@ -139,21 +139,26 @@ ...@@ -139,21 +139,26 @@
} else { } else {
this.discard(); this.discard();
} }
if (withIssueAction) {
this.toggleIssueState();
}
}) })
.catch(() => { .catch(() => {
this.isSubmitting = false; this.isSubmitting = false;
this.discard(false); this.discard(false);
}); });
} else {
this.toggleIssueState();
} }
},
if (withIssueAction) { toggleIssueState() {
this.issueState = this.isIssueOpen ? constants.CLOSED : constants.REOPENED; this.issueState = this.isIssueOpen ? constants.CLOSED : constants.REOPENED;
// This is out of scope for the Notes Vue component. // This is out of scope for the Notes Vue component.
// It was the shortest path to update the issue state and relevant places. // It was the shortest path to update the issue state and relevant places.
const btnClass = this.isIssueOpen ? 'btn-reopen' : 'btn-close'; const btnClass = this.isIssueOpen ? 'btn-reopen' : 'btn-close';
$(`.js-btn-issue-action.${btnClass}:visible`).trigger('click'); $(`.js-btn-issue-action.${btnClass}:visible`).trigger('click');
}
}, },
discard(shouldClear = true) { discard(shouldClear = true) {
// `blur` is needed to clear slash commands autocomplete cache if event fired. // `blur` is needed to clear slash commands autocomplete cache if event fired.
......
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